List Info

Thread: svn commit: trunk/busybox/libbb




svn commit: trunk/busybox/libbb
country flaguser name
United States
2007-04-14 05:10:41
Author: vda
Date: 2007-04-14 03:10:40 -0700 (Sat, 14 Apr 2007)
New Revision: 18437

Log:
lineedit: do not try to open NULL history file


Modified:
   trunk/busybox/libbb/lineedit.c


Changeset:
Modified: trunk/busybox/libbb/lineedit.c
============================================================
=======
--- trunk/busybox/libbb/lineedit.c	2007-04-14 10:09:57 UTC
(rev 18436)
+++ trunk/busybox/libbb/lineedit.c	2007-04-14 10:10:40 UTC
(rev 18437)
 -953,7
+953,7 
 	state->history[i++] = xstrdup(str);
 	state->cur_history = i;
 	state->cnt_history = i;
-	if (state->flags & SAVE_HISTORY)
+	if ((state->flags & SAVE_HISTORY) &&
state->hist_file)
 		save_history(state->hist_file);
 	USE_FEATURE_EDITING_FANCY_PROMPT(num_ok_lines++;)
 }
 -1273,7
+1273,7 
 	/* With null flags, no other fields are ever used */
 	state = st ? st : (line_input_t*) &const_int_0;
 #if ENABLE_FEATURE_EDITING_SAVEHISTORY
-	if (state->flags & SAVE_HISTORY)
+	if ((state->flags & SAVE_HISTORY) &&
state->hist_file)
 		load_history(state->hist_file);
 #endif
 

_______________________________________________
busybox-cvs mailing list
busybox-cvsbusybox.net
http://busybox.net/cgi-bin/mailman/listinfo/busybox-cvs

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )