* view.c (normal_search) [HAVE_CHARSET]: Fix segmentation fault

on first search.  Writting to readonly "" is not good idea.
This commit is contained in:
Andrew V. Samoilov 2002-10-31 11:55:35 +00:00
parent 25739803a8
commit 1c8f1cb327
2 changed files with 8 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2002-10-31 Andrew V. Samoilov <sav@bcs.zp.ua>
* view.c (normal_search) [HAVE_CHARSET]: Fix segmentation fault
on first search. Writting to readonly "" is not good idea.
2002-10-31 Pavel Roskin <proski@gnu.org>
* main.c (probably_finish_program): Eliminate.

View File

@ -1962,13 +1962,11 @@ static void
normal_search (WView *view, int direction)
{
static char *old;
char *exp = "";
char *exp;
exp = old ? old : exp;
convert_to_display (old);
convert_to_display (exp);
exp = input_dialog (_("Search"), _(" Enter search string:"), exp);
exp = input_dialog (_("Search"), _(" Enter search string:"), old ? old : "");
if ((!exp) || (!*exp)) {
if (exp)