aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-04-14 10:10:40 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-04-14 10:10:40 +0000
commitf906ba0b5515f9075b704eb11487f9175e0abf0f (patch)
tree470421827cff5e05f2f299f069ebc6e96f5d9a88
parent1f7c156d56726cdeeadc5983149304f2e3be36ad (diff)
downloadbusybox-w32-f906ba0b5515f9075b704eb11487f9175e0abf0f.tar.gz
busybox-w32-f906ba0b5515f9075b704eb11487f9175e0abf0f.tar.bz2
busybox-w32-f906ba0b5515f9075b704eb11487f9175e0abf0f.zip
lineedit: do not try to open NULL history file
git-svn-id: svn://busybox.net/trunk/busybox@18437 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--libbb/lineedit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index edc0e513c..59baf23a8 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -953,7 +953,7 @@ static void remember_in_history(const char *str)
953 state->history[i++] = xstrdup(str); 953 state->history[i++] = xstrdup(str);
954 state->cur_history = i; 954 state->cur_history = i;
955 state->cnt_history = i; 955 state->cnt_history = i;
956 if (state->flags & SAVE_HISTORY) 956 if ((state->flags & SAVE_HISTORY) && state->hist_file)
957 save_history(state->hist_file); 957 save_history(state->hist_file);
958 USE_FEATURE_EDITING_FANCY_PROMPT(num_ok_lines++;) 958 USE_FEATURE_EDITING_FANCY_PROMPT(num_ok_lines++;)
959} 959}
@@ -1273,7 +1273,7 @@ int read_line_input(const char* prompt, char* command, int maxsize, line_input_t
1273 /* With null flags, no other fields are ever used */ 1273 /* With null flags, no other fields are ever used */
1274 state = st ? st : (line_input_t*) &const_int_0; 1274 state = st ? st : (line_input_t*) &const_int_0;
1275#if ENABLE_FEATURE_EDITING_SAVEHISTORY 1275#if ENABLE_FEATURE_EDITING_SAVEHISTORY
1276 if (state->flags & SAVE_HISTORY) 1276 if ((state->flags & SAVE_HISTORY) && state->hist_file)
1277 load_history(state->hist_file); 1277 load_history(state->hist_file);
1278#endif 1278#endif
1279 1279