This is synced from dash-0.4.17 and full ready for insert to new busybox

version:
ftp://ftp.simtreas.ru/pub/my/bb/new

News:

- code is smalest!
- support ${var...} expr
- used new very strongly steal controlling terminal
1_00_stable_10817
Eric Andersen 2003-07-28 09:56:35 +00:00
parent 9b47661165
commit c470f4477a
2 changed files with 7609 additions and 7211 deletions

13231
shell/ash.c

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@
* Adam Rogoyski <rogoyski@cs.utexas.edu> * Adam Rogoyski <rogoyski@cs.utexas.edu>
* Dave Cinege <dcinege@psychosis.com> * Dave Cinege <dcinege@psychosis.com>
* Jakub Jelinek (c) 1995 * Jakub Jelinek (c) 1995
* Erik Andersen <andersen@codepoet.org> (Majorly adjusted for busybox) * Erik Andersen <andersee@debian.org> (Majorly adjusted for busybox)
* *
* This code is 'as is' with no warranty. * This code is 'as is' with no warranty.
* *
@ -163,6 +163,11 @@ static int my_gid;
#endif /* CONFIG_FEATURE_COMMAND_TAB_COMPLETION */ #endif /* CONFIG_FEATURE_COMMAND_TAB_COMPLETION */
/* It seems that libc5 doesn't know what a sighandler_t is... */
#if (__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1)
typedef void (*sighandler_t) (int);
#endif
static void cmdedit_setwidth(int w, int redraw_flg); static void cmdedit_setwidth(int w, int redraw_flg);
static void win_changed(int nsig) static void win_changed(int nsig)
@ -1287,8 +1292,12 @@ int cmdedit_read_input(char *prompt, char command[BUFSIZ])
goto_new_line(); goto_new_line();
command[0] = 0; command[0] = 0;
len = 0; len = 0;
#if !defined(CONFIG_ASH)
lastWasTab = FALSE; lastWasTab = FALSE;
put_prompt(); put_prompt();
#else
break_out = 2;
#endif
break; break;
case 4: case 4:
/* Control-d -- Delete one character, or exit /* Control-d -- Delete one character, or exit
@ -1508,7 +1517,7 @@ rewrite_line:
} }
#endif #endif
#endif /* MAX_HISTORY >= 1 */ #endif /* MAX_HISTORY >= 1 */
if(break_out>0) { if(break_out == 1) {
command[len++] = '\n'; /* set '\n' */ command[len++] = '\n'; /* set '\n' */
command[len] = 0; command[len] = 0;
} }
@ -1519,7 +1528,11 @@ rewrite_line:
free(cmdedit_prompt); free(cmdedit_prompt);
#endif #endif
cmdedit_reset_term(); cmdedit_reset_term();
#if !defined(CONFIG_ASH)
return len; return len;
#else
return break_out < 0 ? break_out : len;
#endif
} }