fix more bad #ifdefs, and add a few formatting fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2576 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
8234f672d4
commit
1726050ef9
|
@ -2062,8 +2062,8 @@ char **username_tab_completion(const char *buf, size_t *num_matches,
|
||||||
continue;
|
continue;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
matches = (char **)nrealloc(matches, (*num_matches + 1) *
|
matches = (char **)nrealloc(matches,
|
||||||
sizeof(char *));
|
(*num_matches + 1) * sizeof(char *));
|
||||||
matches[*num_matches] =
|
matches[*num_matches] =
|
||||||
charalloc(strlen(userdata->pw_name) + 2);
|
charalloc(strlen(userdata->pw_name) + 2);
|
||||||
sprintf(matches[*num_matches], "~%s", userdata->pw_name);
|
sprintf(matches[*num_matches], "~%s", userdata->pw_name);
|
||||||
|
@ -2158,8 +2158,8 @@ char **cwd_tab_completion(const char *buf, size_t *num_matches, size_t
|
||||||
free(tmp2);
|
free(tmp2);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
matches = (char **)nrealloc(matches, (*num_matches + 1) *
|
matches = (char **)nrealloc(matches,
|
||||||
sizeof(char *));
|
(*num_matches + 1) * sizeof(char *));
|
||||||
matches[*num_matches] = mallocstrcpy(NULL, nextdir->d_name);
|
matches[*num_matches] = mallocstrcpy(NULL, nextdir->d_name);
|
||||||
++(*num_matches);
|
++(*num_matches);
|
||||||
}
|
}
|
||||||
|
|
|
@ -648,7 +648,7 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
|
||||||
dollars);
|
dollars);
|
||||||
void nanoget_repaint(const char *buf, const char *inputbuf, size_t x);
|
void nanoget_repaint(const char *buf, const char *inputbuf, size_t x);
|
||||||
int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer,
|
int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer,
|
||||||
#ifndef NANO_SMALL
|
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
|
||||||
filestruct *history_list,
|
filestruct *history_list,
|
||||||
#endif
|
#endif
|
||||||
const shortcut *s
|
const shortcut *s
|
||||||
|
@ -657,7 +657,7 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer,
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
int statusq(bool allow_tabs, const shortcut *s, const char *curranswer,
|
int statusq(bool allow_tabs, const shortcut *s, const char *curranswer,
|
||||||
#ifndef NANO_SMALL
|
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
|
||||||
filestruct *history_list,
|
filestruct *history_list,
|
||||||
#endif
|
#endif
|
||||||
const char *msg, ...);
|
const char *msg, ...);
|
||||||
|
|
16
src/winio.c
16
src/winio.c
|
@ -2430,7 +2430,7 @@ void nanoget_repaint(const char *buf, const char *inputbuf, size_t x)
|
||||||
/* Get the input from the keyboard; this should only be called from
|
/* Get the input from the keyboard; this should only be called from
|
||||||
* statusq(). */
|
* statusq(). */
|
||||||
int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer,
|
int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer,
|
||||||
#ifndef NANO_SMALL
|
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
|
||||||
filestruct *history_list,
|
filestruct *history_list,
|
||||||
#endif
|
#endif
|
||||||
const shortcut *s
|
const shortcut *s
|
||||||
|
@ -2446,7 +2446,7 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer,
|
||||||
bool tabbed = FALSE;
|
bool tabbed = FALSE;
|
||||||
/* Whether we've pressed Tab. */
|
/* Whether we've pressed Tab. */
|
||||||
#endif
|
#endif
|
||||||
#ifndef NANO_SMALL
|
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
|
||||||
char *history = NULL;
|
char *history = NULL;
|
||||||
/* The current history string. */
|
/* The current history string. */
|
||||||
char *magichistory = NULL;
|
char *magichistory = NULL;
|
||||||
|
@ -2500,7 +2500,7 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer,
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case NANO_PREVLINE_KEY:
|
case NANO_PREVLINE_KEY:
|
||||||
#ifndef NANO_SMALL
|
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
|
||||||
if (history_list != NULL) {
|
if (history_list != NULL) {
|
||||||
/* If we're scrolling up at the bottom of the
|
/* If we're scrolling up at the bottom of the
|
||||||
* history list, answer isn't blank, and
|
* history list, answer isn't blank, and
|
||||||
|
@ -2526,10 +2526,10 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer,
|
||||||
* statusbar prompt. */
|
* statusbar prompt. */
|
||||||
finished = FALSE;
|
finished = FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* !NANO_SMALL && ENABLE_NANORC */
|
||||||
break;
|
break;
|
||||||
case NANO_NEXTLINE_KEY:
|
case NANO_NEXTLINE_KEY:
|
||||||
#ifndef NANO_SMALL
|
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
|
||||||
if (history_list != NULL) {
|
if (history_list != NULL) {
|
||||||
/* Get the newer search from the history list and
|
/* Get the newer search from the history list and
|
||||||
* save it in answer. If there is no newer search,
|
* save it in answer. If there is no newer search,
|
||||||
|
@ -2550,7 +2550,7 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer,
|
||||||
statusbar_x = strlen(answer);
|
statusbar_x = strlen(answer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* !NANO_SMALL && ENABLE_NANORC */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2564,7 +2564,7 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer,
|
||||||
wrefresh(bottomwin);
|
wrefresh(bottomwin);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NANO_SMALL
|
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
|
||||||
/* Free magichistory if we need to. */
|
/* Free magichistory if we need to. */
|
||||||
if (magichistory != NULL)
|
if (magichistory != NULL)
|
||||||
free(magichistory);
|
free(magichistory);
|
||||||
|
@ -2587,7 +2587,7 @@ int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer,
|
||||||
* The allow_tabs parameter indicates whether we should allow tabs to be
|
* The allow_tabs parameter indicates whether we should allow tabs to be
|
||||||
* interpreted. */
|
* interpreted. */
|
||||||
int statusq(bool allow_tabs, const shortcut *s, const char *curranswer,
|
int statusq(bool allow_tabs, const shortcut *s, const char *curranswer,
|
||||||
#ifndef NANO_SMALL
|
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
|
||||||
filestruct *history_list,
|
filestruct *history_list,
|
||||||
#endif
|
#endif
|
||||||
const char *msg, ...)
|
const char *msg, ...)
|
||||||
|
|
Loading…
Reference in New Issue