From 8b6461fc80404cd48c35df13009b789b135b62a3 Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Sat, 31 May 2008 23:09:40 +0000 Subject: [PATCH] files.c,proto.h,text.c: Fix for conflicts with AIX curses variables, from William Jojo git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4260 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 7 ++++++- src/files.c | 12 ++++++------ src/proto.h | 2 +- src/text.c | 20 ++++++++++---------- 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index e9e7735f..30d48460 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-05-31 Chris Allegretta - * global.c: Fix for compile error when --disable-speller is used (Savannah bug 23227 by Mike Frysinger) + * files.c,proto.h,text.c: Fix for conflicts with AIX curses + variables, from William Jojo + +2008-05-31 Chris Allegretta + * global.c: Fix for compile error when --disable-speller is used + (Savannah bug 23227 by Mike Frysinger) 2008-05-31 Chris Allegretta * Fix for seg fault when window size too small, by diff --git a/src/files.c b/src/files.c index 23898446..1c988c3c 100644 --- a/src/files.c +++ b/src/files.c @@ -2395,7 +2395,7 @@ char *input_tab(char *buf, bool allow_files, size_t *place, bool } else if (!*lastwastab || num_matches < 2) *lastwastab = TRUE; else { - int longest_name = 0, columns, editline = 0; + int longest_name = 0, ncols, editline = 0; /* Now we show a list of the available choices. */ assert(num_matches > 1); @@ -2420,7 +2420,7 @@ char *input_tab(char *buf, bool allow_files, size_t *place, bool /* Each column will be (longest_name + 2) columns wide, i.e. * two spaces between columns, except that there will be * only one space after the last column. */ - columns = (COLS + 1) / (longest_name + 2); + ncols = (COLS + 1) / (longest_name + 2); /* Blank the edit window, and print the matches out * there. */ @@ -2434,11 +2434,11 @@ char *input_tab(char *buf, bool allow_files, size_t *place, bool char *disp; wmove(edit, editline, (longest_name + 2) * - (match % columns)); + (match % ncols)); - if (match % columns == 0 && + if (match % ncols == 0 && editline == editwinrows - 1 && - num_matches - match > columns) { + num_matches - match > ncols) { waddstr(edit, _("(more)")); break; } @@ -2448,7 +2448,7 @@ char *input_tab(char *buf, bool allow_files, size_t *place, bool waddstr(edit, disp); free(disp); - if ((match + 1) % columns == 0) + if ((match + 1) % ncols == 0) editline++; } diff --git a/src/proto.h b/src/proto.h index d068ee4c..3ed75aab 100644 --- a/src/proto.h +++ b/src/proto.h @@ -632,7 +632,7 @@ bool do_wrap(filestruct *line); #if !defined(DISABLE_HELP) || !defined(DISABLE_WRAPJUSTIFY) ssize_t break_line(const char *line, ssize_t goal #ifndef DISABLE_HELP - , bool newline + , bool newln #endif ); #endif diff --git a/src/text.c b/src/text.c index 93277e94..4578bb41 100644 --- a/src/text.c +++ b/src/text.c @@ -761,7 +761,7 @@ bool do_wrap(filestruct *line) * blank, as does a '\n' if newline is TRUE. */ ssize_t break_line(const char *line, ssize_t goal #ifndef DISABLE_HELP - , bool newline + , bool newln #endif ) { @@ -781,13 +781,13 @@ ssize_t break_line(const char *line, ssize_t goal if (is_blank_mbchar(line) #ifndef DISABLE_HELP - || (newline && *line == '\n') + || (newln && *line == '\n') #endif ) { blank_loc = cur_loc; #ifndef DISABLE_HELP - if (newline && *line == '\n') + if (newln && *line == '\n') break; #endif } @@ -810,7 +810,7 @@ ssize_t break_line(const char *line, ssize_t goal if (is_blank_mbchar(line) #ifndef DISABLE_HELP - || (newline && *line == '\n') + || (newln && *line == '\n') #endif ) { if (!found_blank) @@ -834,11 +834,11 @@ ssize_t break_line(const char *line, ssize_t goal while (*line != '\0' && (is_blank_mbchar(line) #ifndef DISABLE_HELP - || (newline && *line == '\n') + || (newln && *line == '\n') #endif )) { #ifndef DISABLE_HELP - if (newline && *line == '\n') + if (newln && *line == '\n') break; #endif @@ -2365,7 +2365,7 @@ void do_spell(void) void do_wordlinechar_count(void) { size_t words = 0, chars = 0; - ssize_t lines = 0; + ssize_t nlines = 0; size_t current_x_save = openfile->current_x; size_t pww_save = openfile->placewewant; filestruct *current_save = openfile->current; @@ -2400,7 +2400,7 @@ void do_wordlinechar_count(void) /* Get the total line and character counts, as "wc -l" and "wc -c" * do, but get the latter in multibyte characters. */ if (old_mark_set) { - lines = openfile->filebot->lineno - + nlines = openfile->filebot->lineno - openfile->fileage->lineno + 1; chars = get_totsize(openfile->fileage, openfile->filebot); @@ -2409,7 +2409,7 @@ void do_wordlinechar_count(void) unpartition_filestruct(&filepart); openfile->mark_set = TRUE; } else { - lines = openfile->filebot->lineno; + nlines = openfile->filebot->lineno; chars = openfile->totsize; } @@ -2421,7 +2421,7 @@ void do_wordlinechar_count(void) /* Display the total word, line, and character counts on the * statusbar. */ statusbar(_("%sWords: %lu Lines: %ld Chars: %lu"), old_mark_set ? - _("In Selection: ") : "", (unsigned long)words, (long)lines, + _("In Selection: ") : "", (unsigned long)words, (long)nlines, (unsigned long)chars); } #endif /* !NANO_TINY */