aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c7
-rw-r--r--shell/cmdedit.c11
-rw-r--r--shell/cmdedit.h2
3 files changed, 14 insertions, 6 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 334d2fddd..d16da82db 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -6204,8 +6204,7 @@ retry:
6204 if (!iflag) 6204 if (!iflag)
6205 nr = safe_read(parsefile->fd, buf, BUFSIZ - 1); 6205 nr = safe_read(parsefile->fd, buf, BUFSIZ - 1);
6206 else { 6206 else {
6207 cmdedit_read_input((char*)cmdedit_prompt, buf); 6207 nr = cmdedit_read_input((char*)cmdedit_prompt, buf);
6208 nr = strlen(buf);
6209 } 6208 }
6210 } 6209 }
6211#else 6210#else
@@ -9445,7 +9444,7 @@ static char *wordtext; /* text of last word returned by readtok
9445 9444
9446static struct nodelist *backquotelist; 9445static struct nodelist *backquotelist;
9447static union node *redirnode; 9446static union node *redirnode;
9448struct heredoc *heredoc; 9447static struct heredoc *heredoc;
9449static int quoteflag; /* set if (part of) last token was quoted */ 9448static int quoteflag; /* set if (part of) last token was quoted */
9450static int startlinno; /* line # where last token started */ 9449static int startlinno; /* line # where last token started */
9451 9450
@@ -12917,7 +12916,7 @@ findvar(struct var **vpp, const char *name)
12917/* 12916/*
12918 * Copyright (c) 1999 Herbert Xu <herbert@debian.org> 12917 * Copyright (c) 1999 Herbert Xu <herbert@debian.org>
12919 * This file contains code for the times builtin. 12918 * This file contains code for the times builtin.
12920 * $Id: ash.c,v 1.10 2001/07/12 20:26:31 andersen Exp $ 12919 * $Id: ash.c,v 1.11 2001/07/17 01:12:35 andersen Exp $
12921 */ 12920 */
12922static int timescmd (int argc, char **argv) 12921static int timescmd (int argc, char **argv)
12923{ 12922{
diff --git a/shell/cmdedit.c b/shell/cmdedit.c
index 540eb7ea7..69f833747 100644
--- a/shell/cmdedit.c
+++ b/shell/cmdedit.c
@@ -1153,7 +1153,8 @@ enum {
1153 * 1153 *
1154 */ 1154 */
1155 1155
1156extern void cmdedit_read_input(char *prompt, char command[BUFSIZ]) 1156
1157int cmdedit_read_input(char *prompt, char command[BUFSIZ])
1157{ 1158{
1158 1159
1159 int break_out = 0; 1160 int break_out = 0;
@@ -1231,10 +1232,15 @@ extern void cmdedit_read_input(char *prompt, char command[BUFSIZ])
1231 * if the len=0 and no chars to delete */ 1232 * if the len=0 and no chars to delete */
1232 if (len == 0) { 1233 if (len == 0) {
1233prepare_to_die: 1234prepare_to_die:
1235#if !defined(BB_FEATURE_ASH)
1234 printf("exit"); 1236 printf("exit");
1235 goto_new_line(); 1237 goto_new_line();
1236 /* cmdedit_reset_term() called in atexit */ 1238 /* cmdedit_reset_term() called in atexit */
1237 exit(EXIT_SUCCESS); 1239 exit(EXIT_SUCCESS);
1240#else
1241 break_out = -1; /* for control stoped jobs */
1242 break;
1243#endif
1238 } else { 1244 } else {
1239 input_delete(); 1245 input_delete();
1240 } 1246 }
@@ -1455,8 +1461,10 @@ prepare_to_die:
1455 num_ok_lines++; 1461 num_ok_lines++;
1456#endif 1462#endif
1457 } 1463 }
1464 if(break_out>0) {
1458 command[len++] = '\n'; /* set '\n' */ 1465 command[len++] = '\n'; /* set '\n' */
1459 command[len] = 0; 1466 command[len] = 0;
1467 }
1460#if defined(BB_FEATURE_CLEAN_UP) && defined(BB_FEATURE_COMMAND_TAB_COMPLETION) 1468#if defined(BB_FEATURE_CLEAN_UP) && defined(BB_FEATURE_COMMAND_TAB_COMPLETION)
1461 input_tab(0); /* strong free */ 1469 input_tab(0); /* strong free */
1462#endif 1470#endif
@@ -1464,6 +1472,7 @@ prepare_to_die:
1464 free(cmdedit_prompt); 1472 free(cmdedit_prompt);
1465#endif 1473#endif
1466 cmdedit_reset_term(); 1474 cmdedit_reset_term();
1475 return len;
1467} 1476}
1468 1477
1469 1478
diff --git a/shell/cmdedit.h b/shell/cmdedit.h
index 1482da3b8..83893572a 100644
--- a/shell/cmdedit.h
+++ b/shell/cmdedit.h
@@ -1,6 +1,6 @@
1#ifndef CMDEDIT_H 1#ifndef CMDEDIT_H
2#define CMDEDIT_H 2#define CMDEDIT_H
3 3
4void cmdedit_read_input(char* promptStr, char* command); /* read a line of input */ 4int cmdedit_read_input(char* promptStr, char* command);
5 5
6#endif /* CMDEDIT_H */ 6#endif /* CMDEDIT_H */