Commit Graph

67 Commits

Author SHA1 Message Date
Eric Andersen
2d5b64273f Cleanup from Gennady Feldman <gfeldman@mail.com> 2000-12-22 18:02:02 +00:00
Matt Kraai
a9819b2908 Use busybox error handling functions wherever possible. 2000-12-22 01:48:07 +00:00
Eric Andersen
e9f07fb6e8 Another sh.c patch from Larry Doolittle. This makes redirects work properly
with non-forking shell builtins.  Especially helpful for "read".  This patch
also beautifies builtin_fg_bg, clarifies the problems with
run_command_predicate, makes if/then/else support the default, and corrects the
sense of the BB_FEATURE_SH_ENVIRONMENT comment.
2000-12-21 18:31:36 +00:00
Eric Andersen
70da6a66d2 Fix a warning in sh.c. Remove use of getline() in md5sum since
nobody else uses it and it is a GNU extension anyways...
2000-12-20 22:59:16 +00:00
Eric Andersen
86349776d0 Ok, this is a pretty major update to sh.c. I renamed all the variables and
function names to conform with the style guide.  I also did a lot of work on
the if-then-alse-fi logic and added prototype (i.e. it segfaults when enabled)
line continuation support.

Furthermore, this patch includes Larry Doolittle's work on restructuring some
of the data structures that represent the job and child_program, allowing
several simplifications and fixing several bugs.

 -Erik
2000-12-18 20:25:50 +00:00
Eric Andersen
f361ac29b0 Mem leak fix from Matt Kraai 2000-12-12 23:45:36 +00:00
Eric Andersen
b2356f6de9 Patch from Matt Kraai to fox sh.c escape problem such that
running things like 'echo "\n\tHi\n\t\!"' and 'echo -e "\n\tHi\n\t\!"'
behave as under bash.
2000-12-11 19:14:40 +00:00
Eric Andersen
f21aa84389 Put in i to getopt, so i will work... 2000-12-08 20:50:30 +00:00
Mark Whitley
f57c944e09 Changed names of functions in utility.c and all affected files, to make
compliant with the style guide. Everybody rebuild your tags file!
2000-12-07 19:56:48 +00:00
Eric Andersen
1e7cea952b Bettwr document the hidden internal sh.c #defines, and which folks
might want to use...
2000-12-06 23:47:38 +00:00
Eric Andersen
1d3523b7aa patch from Larry Doolittle to rename BB_FEATURE_SH_BUILTINS_ALWAYS_WIN
to the more pedantically correct BB_FEATURE_SH_APPLETS_ALWAYS_WIN.
2000-12-06 19:07:39 +00:00
Matt Kraai
3e856ce428 Stop using TRUE and FALSE for exit status. 2000-12-01 02:55:13 +00:00
Eric Andersen
b558e76eb1 Apply some patches from Gennady Feldman <gfeldman@mail.com> to
. /etc/profile, and to emulate bash prompt.  I've cleaned up
his patches a bit and all looks good now...
2000-11-30 22:43:16 +00:00
Eric Andersen
8c725e624a Patch from Larry Doolittle (with minor touchups from me so everything compiles
and works) to use the applet definitions in applets.h to autogenerate the applet
function and usage prototypes.
2000-11-30 00:27:06 +00:00
Eric Andersen
8c2d3f46ab Fix escape char problem. 2000-11-30 00:03:57 +00:00
Eric Andersen
a683ee81d9 "I will always compile before I commit."
"I will always compile before I commit."
"I will always compile before I commit."
 -Erik
2000-11-17 18:51:45 +00:00
Eric Andersen
e5aef92e22 Fix up builtin overrides, and hack in the binary search for finding
matching applets into the shell.
2000-11-17 18:25:26 +00:00
Eric Andersen
50b3113dc2 Add in a new FEATURE (off by default) BB_FEATURE_SH_BUILTINS_ALWAYS_WIN.
Make the sh default to using external commands when a path is provided.
2000-11-17 18:07:30 +00:00
Eric Andersen
46f0beb167 Patch from Gennady Feldman <gfeldman@tradeline.net> to:
1. Opens redirections w/ the right access.
    2. Doesn't do globbing for every single parameter (so it
	doesn't stat every parameter).
2000-11-14 21:59:22 +00:00
Matt Kraai
bbaef66b3f Consolidate handling of some fopen failures. 2000-09-27 02:43:35 +00:00
Eric Andersen
3570a34de4 Renamed "internal.h" to the more sensible "busybox.h".
-Erik
2000-09-25 21:45:58 +00:00
Eric Andersen
d2f5677762 Add in exec support (patch from Torbj?rn Axelsson <torax@cendio.se>)
and disable backticks (since they are still wierdly broken in some
cases.
2000-09-21 02:48:07 +00:00
Eric Andersen
06f64b2370 I think these featires are fairly safe...
-Erik
2000-09-19 07:16:39 +00:00
Matt Kraai
0b2da467a8 Avoid segfaults by not using snprintf to copy strings. 2000-09-19 06:46:44 +00:00
Pavel Roskin
5f84fd7066 "exit NUMBER" should exit, not return 2000-09-15 00:46:51 +00:00
Matt Kraai
131241f71c Backslashes shouldn't be treated as backticks. 2000-09-14 00:43:20 +00:00
Matt Kraai
cbbe4d6bc2 Copy the string terminator. 2000-09-14 00:26:50 +00:00
Matt Kraai
dd450a0ded Don't fork for the . (source) command so that environment settings are
preserved.
2000-09-13 03:43:36 +00:00
Matt Kraai
b89075298e Fix unchecked calls to {m,c,re}alloc so that they print an error and
exit rather than segfaulting (what an improvement).
2000-09-13 02:08:21 +00:00
Matt Kraai
6085c72b6e Reset optind so that getopt works in busybox applets called directly by sh.
Change the behavior of -c to correctly handle $1..$9.
2000-09-06 01:46:18 +00:00
Eric Andersen
851ce895bd Turn off some debug noise.
-Erik
2000-08-21 22:34:23 +00:00
Eric Andersen
6a4c33c5c0 Clean up the nasty blunder I'd made of how different behaviors happen.
-Erik
2000-07-28 17:08:36 +00:00
Eric Andersen
1428c4f136 Oops. Forgot an ifdef
-Erik
2000-07-28 15:19:30 +00:00
Eric Andersen
501c88b245 More sh updates (with related changes to everything else). Switched
to using getopt and cleaned up the resulting mess.  if-then-else-fi
is now basically working (given a bunch of constraints).
 -Erik
2000-07-28 15:14:45 +00:00
Eric Andersen
6a99aaf020 More shell features.... if-then-else-fi is now basically usable (disable
by default pending further debugging).  Added in some basic shell environment
support (i.e. $?, $0-$9, $$, $!, $#).
 -Erik
2000-07-27 00:15:20 +00:00
Eric Andersen
e92108ae6d Minor style cleanups. 2000-07-26 00:53:56 +00:00
Eric Andersen
fad9c1198a Finish off fixing up the memleaks (I think). Added the beginnings of
some if-then-else-fi support (nonfunctional and turned off)
 -Erik
2000-07-25 18:06:52 +00:00
Eric Andersen
6efc48c1ae Sigh -- can't sleep. Clean up some mem leaks, fixed some bugs.
-Erik
2000-07-18 08:16:39 +00:00
Pavel Roskin
9c5fcc3408 New message added to messages.c: full_version
Used where possible
2000-07-17 23:45:12 +00:00
Eric Andersen
a1d187a8a8 Backtick support to infinite (memory limited) levels of nesting is
now implemented...  So now busybox shell can do cool stuff like:

    /home/andersen/CVS/busybox # echo foo `wc README` bar
    foo 71 422 2951 README bar

I love writing cool new features....  Muhahahaha...  (I think this is
leaking a little bit of memory every time it expands a backtick process,
so I still needs to do a bit of cleanup...)
 -Erik
2000-07-17 19:14:41 +00:00
Matt Kraai
bf181b9338 Extract usage information into a separate file. 2000-07-16 20:57:15 +00:00
Eric Andersen
fad04fdd12 More cleanups.
-Erik
2000-07-14 06:49:52 +00:00
Matt Kraai
d537a95fdb Use errorMsg rather than fprintf. 2000-07-14 01:51:25 +00:00
Eric Andersen
ec10b9d534 Add in redimentary backtick suport (doesn't work properly yet, but is
close).
 -Erik
2000-07-14 01:13:11 +00:00
Mark Whitley
37653aaf9c Added some smallish comments to help folks understand why we have two tables
of builtins and the reasoning behind it.
2000-07-12 23:36:17 +00:00
Matt Kraai
be84cd4ef6 Always report the applet name when doing error reporting. 2000-07-12 17:02:35 +00:00
Eric Andersen
34e1941c32 Function name cleanup.
-Erik
2000-07-10 18:47:24 +00:00
Eric Andersen
b2731b11ef Had an extra tcsetpgrp.
-Erik
2000-07-06 16:56:56 +00:00
Eric Andersen
b54833cde0 sh fixes from Marius Groeger <mag@sysgo.de>
-Erik
2000-07-03 23:56:26 +00:00
Eric Andersen
1c314ad655 * Fixed a _horrible_ bug where 'tar -tvf' could unlink
local files!!!  Fix thanks to Marius Groeger <mgroeger@sysgo.de>
* Added support for "sh -c command args...", also thanks to
    Marius Groeger <mgroeger@sysgo.de>

 -Erik
2000-06-28 16:56:25 +00:00