[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nano-devel] small fix: --enable-tiny;question about: check_statusblank(
From: |
Steven Kneizys |
Subject: |
[Nano-devel] small fix: --enable-tiny;question about: check_statusblank();old stuff |
Date: |
Sat, 23 Feb 2002 09:43:10 -0800 (PST) |
Happy weekend everybody!
Earlier added stuff has small troubles with compiling tiny, my stuff
and the main_list shortcutage free code needed a couple tweaks:
*** global.c.old Sat Feb 23 11:58:33 2002
--- global.c Sat Feb 23 12:14:24 2002
***************
*** 246,251 ****
--- 246,252 ----
void shortcut_init(int unjustify)
{
+ int reinit_main_list = 0;
char *nano_help_msg = "", *nano_writeout_msg = "", *nano_exit_msg
= "",
*nano_goto_msg = "", *nano_justify_msg = "", *nano_replace_msg
=
"", *nano_insert_msg = "", *nano_whereis_msg =
***************
*** 271,277 ****
char *nano_openprev_msg = "", *nano_opennext_msg = "";
#endif
- int reinit_main_list = 0;
if (main_list) {
free_shortcutage(&main_list);
reinit_main_list = 1;
--- 272,277 ----
***************
*** 708,717 ****
--- 708,719 ----
/* added by SPK for memory cleanup, gracefully return our malloc()s
*/
int thanks_for_the_memories(void)
{
+ #ifndef DISABLE_OPERATINGDIR
if (operating_dir != NULL)
free(operating_dir);
if (full_operating_dir != NULL)
free(full_operating_dir);
+ #endif
if (last_search != NULL)
free(last_search);
if (last_replace != NULL)
***************
*** 718,725 ****
--- 720,729 ----
free(last_replace);
if (hblank != NULL)
free(hblank);
+ #ifndef DISABLE_SPELLER
if (alt_speller != NULL)
free(alt_speller);
+ #endif
if (help_text != NULL)
free(help_text);
if (filename != NULL)
I thought tiny disabled help, but I didn't have to do anything about
the help_text free above to get it to compile.
Also, if currshortcut is not available then it won't compile, easy fix
though:
--- nano.c.old Sat Feb 23 09:53:34 2002
+++ nano.c Sat Feb 23 10:45:27 2002
@@ -3259,7 +3259,11 @@
/* Look through the main shortcut list to see if we've hit a
shortcut key */
+#if !defined(DISABLE_BROWSER) || !defined(DISABLE_MOUSE) || !defined
(DISABLE_HELP)
for (s = currshortcut; s != NULL && !keyhandled; s = s->next) {
+#else
+ for (s = main_list; s != NULL && !keyhandled; s = s->next) {
+#endif
if (kbinput == s->val ||
(s->misc1 && kbinput == s->misc1) ||
(s->misc2 && kbinput == s->misc2)) {
One thing I also noticed is that the status bar is not always blanked
consistently, depending on what is going on it skips the do_char where
the countdown is actually checked. You can open a file and hit <enter>
and <backspace> all day and it won't blank out the message for example.
Would it be okay to move the call to check_statblank() from do_char up
to just below
kbinput = wgetch(edit);
in the main loop? Or would that mess things up with multiple character
sequences with one 'keystroke' counting more than once? Maybe it is
just fine the way it is :)
--- David Lawrence Ramsey <address@hidden> wrote:
<snip>
> Nice, but it needs one last tweak; if you have a "New Buffer"
> open, the name will be "", so the prompt will be "Switched
> to ". Maybe this would do it:
>
> statusbar(_("Switched to "), ((open_files->data[0] ==
> '\0') ? open_files->data : "New Buffer"));
>
I tried it, it failed and didn't detect the null string, not sure why,
I changed it to:
statusbar(_("Switched to %s"),
((strcmp(open_files->data,"") ? open_files->data : "New Buffer")));
and it worked. I have a headache and so I have no idea if why it
didn't work was osf or me ;-)
I was thinking more about the size allocation thing, and what if the
char size is not 1, then this gives the string length I think:
#define my_stringify(x) #x
#define get_str_len(x) \
((sizeof(my_stringify(x))-sizeof(""))/(sizeof(char)))
#define INT_MAX_DIGITS get_str_len(INT_MAX)
Something I didn't fix, just noticed, is on enable-tiny on osf's cc it
comes up with an unresolved strcasestr that it didn't seem to on linux.
Thanks!
Steve...
__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com
- Re: [Nano-devel] merged patch, (continued)
Re: [Nano-devel] merged patch, Steven Kneizys, 2002/02/21
- Re: [Nano-devel] merged patch, Chris Allegretta, 2002/02/21
- Re: [Nano-devel] merged patch, Chris Allegretta, 2002/02/21
- Re: [Nano-devel] merged patch, Dwayne Rightler, 2002/02/22
- Re: [Nano-devel] merged patch, Steven Kneizys, 2002/02/22
- [Nano-devel] Now that we really don't need it . . ., Steven Kneizys, 2002/02/23
- [Nano-devel] small fix: --enable-tiny;question about: check_statusblank();old stuff,
Steven Kneizys <=
- [Nano-devel] 1.1.6 mem leaks revisited, Steven Kneizys, 2002/02/24
- Re: [Nano-devel] 1.1.6 mem leaks revisited, Chris Allegretta, 2002/02/26
Re: [Nano-devel] merged patch, Steven Kneizys, 2002/02/22
Re: [Nano-devel] merged patch, Gareth Pearce, 2002/02/21
Re: [Nano-devel] merged patch, David Lawrence Ramsey, 2002/02/22