aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2012-03-22 16:14:13 +0000
committerRon Yorston <rmy@pobox.com>2012-03-22 16:14:13 +0000
commit800c3f176fb21e30fbaa81ef68f50e601ea2f78b (patch)
tree84f4a2bf30d3208a020b25c82c11ac636c7072c6 /shell
parent9db164d6e39050d09f38288c6045cd2a2cbf6d63 (diff)
parentf99811908419608e3ab81393d0177cc456101e4b (diff)
downloadbusybox-w32-800c3f176fb21e30fbaa81ef68f50e601ea2f78b.tar.gz
busybox-w32-800c3f176fb21e30fbaa81ef68f50e601ea2f78b.tar.bz2
busybox-w32-800c3f176fb21e30fbaa81ef68f50e601ea2f78b.zip
Merge commit '1_19_4' into merge_1_19
Diffstat (limited to 'shell')
-rw-r--r--shell/cttyhack.c8
-rw-r--r--shell/hush.c18
2 files changed, 16 insertions, 10 deletions
diff --git a/shell/cttyhack.c b/shell/cttyhack.c
index 4261289b4..37ea13723 100644
--- a/shell/cttyhack.c
+++ b/shell/cttyhack.c
@@ -122,10 +122,12 @@ int cttyhack_main(int argc UNUSED_PARAM, char **argv)
122 do { 122 do {
123#ifdef __linux__ 123#ifdef __linux__
124 int s = open_read_close("/sys/class/tty/console/active", 124 int s = open_read_close("/sys/class/tty/console/active",
125 console + 5, sizeof(console) - 5 - 1); 125 console + 5, sizeof(console) - 5);
126 if (s > 0) { 126 if (s > 0) {
127 /* found active console via sysfs (Linux 2.6.38+) */ 127 /* found active console via sysfs (Linux 2.6.38+)
128 console[5 + s] = '\0'; 128 * sysfs string looks like "ttyS0\n" so zap the newline:
129 */
130 console[4 + s] = '\0';
129 break; 131 break;
130 } 132 }
131 133
diff --git a/shell/hush.c b/shell/hush.c
index e4138adf7..de0af9cec 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -7817,20 +7817,24 @@ int hush_main(int argc, char **argv)
7817 7817
7818#if ENABLE_FEATURE_EDITING 7818#if ENABLE_FEATURE_EDITING
7819 G.line_input_state = new_line_input_t(FOR_SHELL); 7819 G.line_input_state = new_line_input_t(FOR_SHELL);
7820# if defined MAX_HISTORY && MAX_HISTORY > 0 && ENABLE_HUSH_SAVEHISTORY 7820# if MAX_HISTORY > 0 && ENABLE_HUSH_SAVEHISTORY
7821 { 7821 {
7822 const char *hp = get_local_var_value("HISTFILE"); 7822 const char *hp = get_local_var_value("HISTFILE");
7823 if (!hp) { 7823 if (!hp) {
7824 hp = get_local_var_value("HOME"); 7824 hp = get_local_var_value("HOME");
7825 if (hp) { 7825 if (hp)
7826 G.line_input_state->hist_file = concat_path_file(hp, ".hush_history"); 7826 hp = concat_path_file(hp, ".hush_history");
7827 //set_local_var(xasprintf("HISTFILE=%s", ...)); 7827 } else {
7828 } 7828 hp = xstrdup(hp);
7829 } 7829 }
7830# if ENABLE_FEATURE_SH_HISTFILESIZE 7830 if (hp) {
7831 G.line_input_state->hist_file = hp;
7832 //set_local_var(xasprintf("HISTFILE=%s", ...));
7833 }
7834# if ENABLE_FEATURE_SH_HISTFILESIZE
7831 hp = get_local_var_value("HISTFILESIZE"); 7835 hp = get_local_var_value("HISTFILESIZE");
7832 G.line_input_state->max_history = size_from_HISTFILESIZE(hp); 7836 G.line_input_state->max_history = size_from_HISTFILESIZE(hp);
7833# endif 7837# endif
7834 } 7838 }
7835# endif 7839# endif
7836#endif 7840#endif