Commit 3925bdaf authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

fix erroneous #ifdef that caused a compilation problem when

--enable-nanorc wasn't used and --enable-extra was, and make sure we put
back the keystroke that breaks us out of the credits (if any)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2607 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 18 additions and 5 deletions
+18 -5
...@@ -54,6 +54,11 @@ CVS code - ...@@ -54,6 +54,11 @@ CVS code -
and NANO_APPEND_KEY are. Changes to shortcut_init(), usage(), and NANO_APPEND_KEY are. Changes to shortcut_init(), usage(),
main(), search_init(), nanorc.sample, nano.1, nanorc.5, main(), search_init(), nanorc.sample, nano.1, nanorc.5,
nano.texi, etc. (DLR) nano.texi, etc. (DLR)
- chars.c:
make_mbstring()
- Change erroneous ENABLE_EXTRA #ifdef to NANO_EXTRA to fix a
compilation problem when --enable-nanorc isn't used and
--enable-extra is. (DLR)
- cut.c: - cut.c:
cut_line() cut_line()
- Set placewewant properly after cutting a line, to avoid a - Set placewewant properly after cutting a line, to avoid a
...@@ -178,6 +183,11 @@ CVS code - ...@@ -178,6 +183,11 @@ CVS code -
total_update() total_update()
- Simplify to call clearok(TRUE) and wrefresh() on edit, which - Simplify to call clearok(TRUE) and wrefresh() on edit, which
updates the entire screen in fewer function calls. (DLR) updates the entire screen in fewer function calls. (DLR)
do_credits()
- Save the keystroke that breaks us out of the credits (if any)
and put it back so that it isn't lost. This is especially
needed if the keystroke is part of a multibyte character.
(DLR)
- configure.ac: - configure.ac:
- Minor tweaks to some of the test blocks to avoid XSI:isms. - Minor tweaks to some of the test blocks to avoid XSI:isms.
(DLR, adapted from a Debian patch for GNU ed by David (DLR, adapted from a Debian patch for GNU ed by David
......
...@@ -301,7 +301,7 @@ char *make_mbchar(int chr, int *chr_mb_len) ...@@ -301,7 +301,7 @@ char *make_mbchar(int chr, int *chr_mb_len)
return chr_mb; return chr_mb;
} }
#if defined(ENABLE_NANORC) || defined(ENABLE_EXTRA) #if defined(ENABLE_NANORC) || defined(NANO_EXTRA)
/* Convert the string str to a valid multibyte string with the same wide /* Convert the string str to a valid multibyte string with the same wide
* character values as str. Return the (dynamically allocated) * character values as str. Return the (dynamically allocated)
* multibyte string. */ * multibyte string. */
......
...@@ -4020,7 +4020,7 @@ void dump_buffer_reverse(void) ...@@ -4020,7 +4020,7 @@ void dump_buffer_reverse(void)
/* Easter egg: Display credits. Assume nodelay(edit) is FALSE. */ /* Easter egg: Display credits. Assume nodelay(edit) is FALSE. */
void do_credits(void) void do_credits(void)
{ {
int crpos = 0, xlpos = 0; int kbinput = ERR, crpos = 0, xlpos = 0;
const char *credits[CREDIT_LEN] = { const char *credits[CREDIT_LEN] = {
NULL, /* "The nano text editor" */ NULL, /* "The nano text editor" */
NULL, /* "version" */ NULL, /* "version" */
...@@ -4101,7 +4101,7 @@ void do_credits(void) ...@@ -4101,7 +4101,7 @@ void do_credits(void)
wrefresh(bottomwin); wrefresh(bottomwin);
for (crpos = 0; crpos < CREDIT_LEN + editwinrows / 2; crpos++) { for (crpos = 0; crpos < CREDIT_LEN + editwinrows / 2; crpos++) {
if (wgetch(edit) != ERR) if ((kbinput = wgetch(edit)) != ERR)
break; break;
if (crpos < CREDIT_LEN) { if (crpos < CREDIT_LEN) {
...@@ -4129,16 +4129,19 @@ void do_credits(void) ...@@ -4129,16 +4129,19 @@ void do_credits(void)
napms(700); napms(700);
scroll(edit); scroll(edit);
wrefresh(edit); wrefresh(edit);
if (wgetch(edit) != ERR) if ((kbinput = wgetch(edit)) != ERR)
break; break;
napms(700); napms(700);
scroll(edit); scroll(edit);
wrefresh(edit); wrefresh(edit);
} }
if (kbinput != ERR)
ungetch(kbinput);
curs_set(1);
scrollok(edit, FALSE); scrollok(edit, FALSE);
nodelay(edit, FALSE); nodelay(edit, FALSE);
curs_set(1);
total_refresh(); total_refresh();
} }
#endif #endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment