From fc99820d832c512631aa418520f5bc6a204e8b91 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Wed, 15 Aug 2001 22:23:14 -0400 Subject: snapshot of project "lynx", label v2-8-5dev_2 --- src/LYStrings.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src/LYStrings.c') diff --git a/src/LYStrings.c b/src/LYStrings.c index 3f4b9d1b..9960f626 100644 --- a/src/LYStrings.c +++ b/src/LYStrings.c @@ -703,7 +703,7 @@ PUBLIC int LYmbcsstrlen ARGS3( #define GetChar() wgetch(my_subwindow ? my_subwindow : LYwin) #endif -#if !defined(GetChar) && defined(PDCURSES) +#if !defined(GetChar) && defined(PDCURSES) && defined(PDC_BUILD) && PDC_BUILD >= 2401 /* PDCurses sends back key-modifiers that we don't use, but would waste time * upon, e.g., repainting the status line */ @@ -2540,6 +2540,18 @@ PUBLIC void LYTrimLeading ARGS1( ; } +/* + * Trim trailing newline(s) from a string + */ +PUBLIC char * LYTrimNewline ARGS1( + char *, buffer) +{ + size_t i = strlen(buffer); + while (i != 0 && buffer[i-1] == '\n') + buffer[--i] = 0; + return buffer; +} + /* * Trim trailing blanks from a string */ @@ -4761,13 +4773,8 @@ again: while (cur_choice < num_options && strcasecomp(data[cur_choice], MyEdit.buffer) < 0) cur_choice++; -#ifdef USE_SLANG - old_y = SLsmg_get_row(); - old_x = SLsmg_get_column(); -#else - getyx(LYwin, old_y, old_x); -#endif + LYGetYX(old_y, old_x); cur_choice = LYhandlePopupList( cur_choice, 0, @@ -4783,11 +4790,7 @@ again: _statusline(": "); reinsertEdit(&MyEdit, data[cur_choice]); } -#ifdef USE_SLANG - SLsmg_gotorc(old_y, old_x); -#else wmove(LYwin, old_y, old_x); -#endif FREE(data); } } else { -- cgit 1.4.1-2-gfad0