aboutsummaryrefslogtreecommitdiff
path: root/shell (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix a race. Sometimes by the time we got to checkjobs(), theandersen2001-05-221-12/+27
| | | | | | | | pipe struct had already been freed. Return immediately if the pipe is NULL. git-svn-id: svn://busybox.net/trunk/busybox@2708 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Oops. Remove some debug noise I left in.andersen2001-05-221-5/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2707 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Updates from both Vladimir and Larryandersen2001-05-221-64/+89
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2706 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Lars Kellogg-Stedman <lars@larsshack.org> to fix bugandersen2001-05-213-13/+13
| | | | | | | #1130 (i.e. When you turn on features it should always ADD features) git-svn-id: svn://busybox.net/trunk/busybox@2690 69ca8d6d-28ef-0310-b511-8ec308f3f277
* The latest patch from Larryandersen2001-05-211-31/+61
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2682 69ca8d6d-28ef-0310-b511-8ec308f3f277
* This is a patch from Vladimir:andersen2001-05-191-198/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | > I rewrite *local_variable* function in hush.c with: > 1) remove many memory leaks > 2) add support read_only protect (require write builtin function for set this, > I write this special for variable HUSH_VERION=0.01) > 3) commad read set only local variable now > 4) remove many error messages if "set unset export" not defined variable > (bash syntax not put and set error code). Hmm, if I set result to -1, you hush > called waitpid and returned with error "no waitpid" ( i not found place this > error). > 5) destroy error in new version check xgetcwd()==NULL and set "(unknow)" - > this have error: crashe in next call `pwd`, but xgetcwd(not null) called > free(arg). > 6) next add integraion with libbb Valdimir's patch missed two cases of local variable handling FOO=bar export FOO=baz unset FOO and export FOO=bar FOO=baz which were working before, so I fixed those two cases. git-svn-id: svn://busybox.net/trunk/busybox@2677 69ca8d6d-28ef-0310-b511-8ec308f3f277
* It turns out job control in both hush and lash was broken by theandersen2001-05-172-10/+26
| | | | | | | | | signal handling in cmdedit.c. Disabling it makes the shells behave themselves again. hush isn't quite there, but is getting close... -Erik git-svn-id: svn://busybox.net/trunk/busybox@2663 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Change 'printf("%s\n", ...)' into 'puts(...)'. Noted and patched in hostname.ckraai2001-05-161-2/+2
| | | | | | | by Larry Doolittle. git-svn-id: svn://busybox.net/trunk/busybox@2653 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Move init of a bunch of globals into main so we are at leastandersen2001-05-161-7/+16
| | | | | | | | a bit more reentrant. -Erik git-svn-id: svn://busybox.net/trunk/busybox@2652 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix the behavior of local shell variables to match that of bash and ash.andersen2001-05-151-25/+109
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@2651 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Oops. I left in some debug noise.andersen2001-05-151-1/+0
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2646 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Write set_local_var() and fixup lookup_param() so you can now useandersen2001-05-151-4/+101
| | | | | | | | shell local variables. -Erik git-svn-id: svn://busybox.net/trunk/busybox@2645 69ca8d6d-28ef-0310-b511-8ec308f3f277
* This patch covers one big part of variable handling.andersen2001-05-151-5/+49
| | | | | | | | | | | | | | | | | | $ a=b foo should be handled correctly. $ a=b is parsed OK, but the actual variable setting is not yet written. Except for some weird exceptions related to quoting rules, this code passes (matches ash behavior) all the tests I threw at it. If someone now writes set_local_var(), and updates lookup_param() to match, we can claim success! - Larry git-svn-id: svn://busybox.net/trunk/busybox@2644 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix up some silly warningsandersen2001-05-112-6/+6
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2614 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix a segfault in lash, hush, and cmdedit. Each of these usedandersen2001-05-113-2/+17
| | | | | | | | | xgetcwd, but did not check the return for a NULL, and then continued to call strlen on the NULL when the cwd had been removed from under it. -Erik git-svn-id: svn://busybox.net/trunk/busybox@2613 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Use xgetcwdandersen2001-05-111-2/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2612 69ca8d6d-28ef-0310-b511-8ec308f3f277
* A few more structural updates for job control.andersen2001-05-081-4/+13
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@2573 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix a stupid segfault caused by dereferencing a NULL ptr.andersen2001-05-081-0/+2
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@2572 69ca8d6d-28ef-0310-b511-8ec308f3f277
* This patch from Evin Robertson <nitfol@my-deja.com> fixes export so it works.andersen2001-05-071-1/+4
| | | | | | | | This way leaks memory, but oh well. We will probably fix that when we get around to doing local variables. git-svn-id: svn://busybox.net/trunk/busybox@2570 69ca8d6d-28ef-0310-b511-8ec308f3f277
* More hush updates from Larry:andersen2001-05-071-19/+54
| | | | | | | | | | Update some comments. Generate partial placeholders for the missing builtins. Write builtin_umask. Properly treat exec without arguments as a means to open/close files within the running script. Implement "4<&-" that encodes for file descriptor closure. git-svn-id: svn://busybox.net/trunk/busybox@2555 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Larry's variant on Evin Robertson's fix to what I messed upandersen2001-05-041-1/+1
| | | | | | | | | trying to make job control work. This fix makes it so that hush doesn't error out when init hasn't set up job control, as in when init=/bin/sh git-svn-id: svn://busybox.net/trunk/busybox@2537 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Don't reset parents context when we encounter an terminator. Fixeskraai2001-05-041-1/+0
| | | | | | | if true; then if true; then true; fi; fi git-svn-id: svn://busybox.net/trunk/busybox@2534 69ca8d6d-28ef-0310-b511-8ec308f3f277
* If it fails to run a builtin, let it fall through toandersen2001-05-041-1/+0
| | | | | | | | exec the real thing. -Erik git-svn-id: svn://busybox.net/trunk/busybox@2531 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Move up waitpid error check so that errno isn't clobbered by tcsetpgrp.kraai2001-05-021-3/+3
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2519 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Some more job control updates. It will now sucessfully backgroundandersen2001-05-021-46/+74
| | | | | | | | stuff. Good luck getting things back into the foreground though... -Erik git-svn-id: svn://busybox.net/trunk/busybox@2516 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Don't treat newline as pipe separator when processing substitutions.kraai2001-05-021-1/+4
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2515 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix $(...) construction. Noted and patched by Larry Doolittlekraai2001-05-021-0/+1
| | | | | | | <ldoolitt@recycle.lbl.gov>. I'm just a patch whore. :) git-svn-id: svn://busybox.net/trunk/busybox@2513 69ca8d6d-28ef-0310-b511-8ec308f3f277
* First pass at getting job control working. This gets the infrastructureandersen2001-05-021-13/+142
| | | | | | | | | in place, but something is still missing/wrong in there. Testing with 'grep foo &' seems to put _hush_ into the background. Pondering... -Erik git-svn-id: svn://busybox.net/trunk/busybox@2512 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Use the current pgrp, not pid, when resetting the foreground process group.kraai2001-05-021-1/+1
| | | | | | | Fixes bizarre suspension when executing `echo`. git-svn-id: svn://busybox.net/trunk/busybox@2511 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Don't segfault if the first word is the empty string.kraai2001-05-021-2/+4
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2510 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Another update from Larry:andersen2001-05-021-17/+19
| | | | | | | | Makes hush return code equal to that of the last command executed. Fixes the mode where input comes from a file. git-svn-id: svn://busybox.net/trunk/busybox@2509 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Another hush update from Larry:andersen2001-05-011-5/+13
| | | | | | | | | | | | | | | | | Minor improvements. Something is still broken with running scripts via "hush filename". All the following are now handled acceptably (matches ash, not bash). if true; then echo foo1; fi if true; then echo foo2; fi if true; false; then echo bar; else echo foo3; fi if true || false; then echo foo4; fi - Larry git-svn-id: svn://busybox.net/trunk/busybox@2500 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Some more hush.c updates from Larry Doolittle.andersen2001-04-301-13/+46
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2497 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Use BUFSIZ for the_command to match size used in cmdeditandersen2001-04-271-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2475 69ca8d6d-28ef-0310-b511-8ec308f3f277
* An update to hush from Larry:andersen2001-04-271-94/+20
| | | | | | | | | | | | | | It should recover more smoothly from syntax errors, and it now has a decent guess when the reserved word construct is over (or not) to control execution and prompting. I took out all the redundant standalone test copies of libbb routines, but left in a hook so I can include those for my testing. I'll post that include file on my web site. - Larry git-svn-id: svn://busybox.net/trunk/busybox@2474 69ca8d6d-28ef-0310-b511-8ec308f3f277
* This is the initial checkin of Larry Doolittle's hush.c, using hisandersen2001-04-261-0/+2191
| | | | | | | | | | | | | | | April 25, 2001 snapshot, adjusted a bit by me so it has cmdedit support. This checkin also removes sh.c. In the future sh.c will be a symlink to your shell of choice. For now, this symlink will default to pointing to lash.c (as in the past). If you change the symlink to point to hush.c, then thats what you will get. This symlink business is a temporary situation, which will be cleaned up Real Soon Now(tm). -Erik git-svn-id: svn://busybox.net/trunk/busybox@2466 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Moved some #ifdefs down below #include "busybox.h" where they belong.markw2001-04-251-2/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2436 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Some patches from Gennady Feldman. Fixed a glob problem such thatandersen2001-04-232-6/+8
| | | | | | | | 'ls *.h Config.h' works. Fixed a silly typo with fg/bg process control. Made cmdedit exit sanely when it cannot read input. git-svn-id: svn://busybox.net/trunk/busybox@2402 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Another banner consolidation from Larry Doolittle <ldoolitt@recycle.lbl.gov>.kraai2001-04-121-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2339 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix handling of '' and "".kraai2001-04-121-4/+6
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2334 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Apply Vladimir's latest cleanup patch.andersen2001-04-092-174/+112
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@2288 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Add support of /W promptsandersen2001-04-051-0/+13
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@2265 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Avoid segfault when export is invoked with no arguments. Thanks tokraai2001-04-041-0/+1
| | | | | | | Gennady Feldman. git-svn-id: svn://busybox.net/trunk/busybox@2241 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Add in a new standalone env applet for fixing up app's environmentsandersen2001-03-291-16/+5
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@2224 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix to last patch: locale code should be 9, not 7.markw2001-03-271-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2199 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Applied patch from Vladimir N. Oleynik to add locale support to the shell permarkw2001-03-271-0/+6
| | | | | | | bug report from Ralph Jones. git-svn-id: svn://busybox.net/trunk/busybox@2198 69ca8d6d-28ef-0310-b511-8ec308f3f277
* -Wshadow sh fix from Jeff Garzikandersen2001-03-231-2/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2190 69ca8d6d-28ef-0310-b511-8ec308f3f277
* A nice patch from Larry Doolittle that adds -Wshadow andandersen2001-03-211-35/+35
| | | | | | | cleans up most of the now-revealed problems. git-svn-id: svn://busybox.net/trunk/busybox@2177 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Another cleanup patch from Jeff Garzik <jgarzik@mandrakesoft.com>andersen2001-03-191-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2163 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix to cmdedit.c from Vladimirandersen2001-03-191-0/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2138 69ca8d6d-28ef-0310-b511-8ec308f3f277