aboutsummaryrefslogtreecommitdiff
path: root/shell/cmdedit.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/cmdedit.c')
-rw-r--r--shell/cmdedit.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/shell/cmdedit.c b/shell/cmdedit.c
index 59226aff5..0af1a2ad0 100644
--- a/shell/cmdedit.c
+++ b/shell/cmdedit.c
@@ -216,7 +216,7 @@ static void cmdedit_set_out_char(int next_char)
216 printf("\033[7m%c\033[0m", c); 216 printf("\033[7m%c\033[0m", c);
217 } else 217 } else
218#endif 218#endif
219 putchar(c); 219 if (initial_settings.c_lflag & ECHO) putchar(c);
220 if (++cmdedit_x >= cmdedit_termw) { 220 if (++cmdedit_x >= cmdedit_termw) {
221 /* terminal is scrolled down */ 221 /* terminal is scrolled down */
222 cmdedit_y++; 222 cmdedit_y++;
@@ -546,8 +546,8 @@ static void cmdedit_init(void)
546 my_euid = geteuid(); 546 my_euid = geteuid();
547 entry = getpwuid(my_euid); 547 entry = getpwuid(my_euid);
548 if (entry) { 548 if (entry) {
549 user_buf = bb_xstrdup(entry->pw_name); 549 user_buf = xstrdup(entry->pw_name);
550 home_pwd_buf = bb_xstrdup(entry->pw_dir); 550 home_pwd_buf = xstrdup(entry->pw_dir);
551 } 551 }
552#endif 552#endif
553 553
@@ -634,7 +634,7 @@ static void username_tab_completion(char *ud, char *with_shash_flg)
634 while ((entry = getpwent()) != NULL) { 634 while ((entry = getpwent()) != NULL) {
635 /* Null usernames should result in all users as possible completions. */ 635 /* Null usernames should result in all users as possible completions. */
636 if ( /*!userlen || */ !strncmp(ud, entry->pw_name, userlen)) { 636 if ( /*!userlen || */ !strncmp(ud, entry->pw_name, userlen)) {
637 add_match(bb_xasprintf("~%s", entry->pw_name), '/'); 637 add_match(xasprintf("~%s", entry->pw_name), '/');
638 } 638 }
639 } 639 }
640 640
@@ -684,7 +684,7 @@ static int path_parse(char ***p, int flags)
684 *p = xmalloc(npth * sizeof(char *)); 684 *p = xmalloc(npth * sizeof(char *));
685 685
686 tmp = pth; 686 tmp = pth;
687 (*p)[0] = bb_xstrdup(tmp); 687 (*p)[0] = xstrdup(tmp);
688 npth = 1; /* count words is + 1 count ':' */ 688 npth = 1; /* count words is + 1 count ':' */
689 689
690 for (;;) { 690 for (;;) {
@@ -1114,7 +1114,7 @@ static void input_tab(int *lastWasTab)
1114 if (!matches) 1114 if (!matches)
1115 return; /* not found */ 1115 return; /* not found */
1116 /* find minimal match */ 1116 /* find minimal match */
1117 tmp1 = bb_xstrdup(matches[0]); 1117 tmp1 = xstrdup(matches[0]);
1118 for (tmp = tmp1; *tmp; tmp++) 1118 for (tmp = tmp1; *tmp; tmp++)
1119 for (len_found = 1; len_found < num_matches; len_found++) 1119 for (len_found = 1; len_found < num_matches; len_found++)
1120 if (matches[len_found][(tmp - tmp1)] != *tmp) { 1120 if (matches[len_found][(tmp - tmp1)] != *tmp) {
@@ -1175,7 +1175,7 @@ static void get_previous_history(void)
1175{ 1175{
1176 if(command_ps[0] != 0 || history[cur_history] == 0) { 1176 if(command_ps[0] != 0 || history[cur_history] == 0) {
1177 free(history[cur_history]); 1177 free(history[cur_history]);
1178 history[cur_history] = bb_xstrdup(command_ps); 1178 history[cur_history] = xstrdup(command_ps);
1179 } 1179 }
1180 cur_history--; 1180 cur_history--;
1181} 1181}
@@ -1856,7 +1856,7 @@ rewrite_line:
1856 for(i = 0; i < (MAX_HISTORY-1); i++) 1856 for(i = 0; i < (MAX_HISTORY-1); i++)
1857 history[i] = history[i+1]; 1857 history[i] = history[i+1];
1858 } 1858 }
1859 history[i++] = bb_xstrdup(command); 1859 history[i++] = xstrdup(command);
1860 cur_history = i; 1860 cur_history = i;
1861 n_history = i; 1861 n_history = i;
1862#if defined(CONFIG_FEATURE_SH_FANCY_PROMPT) 1862#if defined(CONFIG_FEATURE_SH_FANCY_PROMPT)