Commit Graph

129 Commits

Author SHA1 Message Date
Eric Andersen
ce89871ff7 Urg. Remove the debug noise 2001-03-09 19:43:57 +00:00
Eric Andersen
195743f195 Ok, sh.c should be working now. Many thanks to Larry Doolittle
for his timely help -- nearly all of the work in this patch is
his.
 -Erik
2001-03-09 19:21:37 +00:00
Eric Andersen
01658a3eec Fix sh.c for the glab case. I was messing things up for
single argument commands.  It should now work as expected...
 -Erik
2001-03-09 01:24:02 +00:00
Eric Andersen
3dbf1e877a A '.' is a legal seperator. 2001-03-09 01:08:06 +00:00
Eric Andersen
b180dd9e50 Cleanup patch from Larry 2001-03-09 00:42:46 +00:00
Eric Andersen
13d1fa1d01 Add in 'trim' routine. Fix up sh.c so it works when wordexp
is not available.
 -Erik
2001-03-08 23:59:45 +00:00
Mark Whitley
7e5291f111 Whitespace / formatting / bracket cleanup. 2001-03-08 19:31:12 +00:00
Eric Andersen
32f8c170b0 Remember to delete un-expandable variables, and do a better job of expanding
shell-specific things in case the wordexp implementation is broken (ie. the
stubbed out wordexp in uClibc).
 -Erik
2001-03-08 17:44:37 +00:00
Eric Andersen
ca6045955d Rework environment variable handling to use wordexp, per a suggestion from
Larry Doolittle a couple of months ago.  This makes the stuff-expansion in lash
be ever so standards compliant.   This change needs testing by everyone, but
appears to be solid enough to let us close bug #1090.

It works for me; however, please test this change!
 -Erik
2001-03-08 17:17:13 +00:00
Eric Andersen
11ae573320 remove an unused variable 2001-03-07 03:51:27 +00:00
Eric Andersen
702ec5926f Fix the memory leak. No really this time.
-Erik
2001-03-06 22:17:29 +00:00
Eric Andersen
36278b9576 Fix func prototype 2001-03-06 20:47:31 +00:00
Eric Andersen
54851d3c65 Fixed a memory leak in lash. It seems that close_all was calling close()
directly instead of calling mark_closed(), which allowed the memory allocated
by mark_open() to never be freed.
 -Erik
2001-03-06 20:44:39 +00:00
Eric Andersen
07f2f3917a Close open files before calling builtin_exec(). I've tested this
and it fixes bug #1121.
 -Erik
2001-03-06 20:28:22 +00:00
Eric Andersen
5165fbed63 Oops. Since dirent.h depends on BB_FEATURE_SH_TAB_COMPLETION, put it
after busybox.h is included.
2001-02-20 06:42:29 +00:00
Eric Andersen
caeeb36784 This fixes lash so it handles environment variable expansion, regardless
of where the environment variables are located in an argument.  This allows
things like 'echo foo$1$SHELL' to expand the same way bash would expand it.
Of course, to make this work I introduced a memory leak, and I am too tired
to find a way to fix it.
 -Erik
2001-02-20 06:38:44 +00:00
Eric Andersen
cbe31dace5 It turns out that DODMALLOC was broken when I reorganized busybox.h
header file usage before the 0.49 release.  To fix it, I had to move
the '#include "busybox.h"' to the end of the list of #include files.
 -Erik
2001-02-20 06:14:08 +00:00
Eric Andersen
94456f5984 Put back Vladimir's testing defines, which I mistakenly removed. 2001-02-18 20:26:48 +00:00
Eric Andersen
28a78ab62c Several features were hard coded on. Stop that. List tab completion
as working (thanks Vladimir!) and taking 4k.
 -Erik
2001-02-16 20:26:50 +00:00
Eric Andersen
6faae7deb4 Commit Vladimir's latest cmdedit. I modified it slightly to ensure
parse_prompt() would be called before cmdedit_init(), since cmdedit_init()
calls cmdedit_setwidth() which uses cmdedit_prmt_len, which is set by
parse_prompt().  Also, added a mod, so very narrow terminals should now wrap
properly...  This is working very nicely for me -- Vladimir has done some
very good work.
2001-02-16 20:09:17 +00:00
Eric Andersen
5f2c79d8c7 Make ar be crossed. 2001-02-16 18:36:04 +00:00
Eric Andersen
67991cf824 This patch, put together by Manuel Novoa III, is a merge of work
done by Evin Robertson (bug#1105) and work from Manuel to make
usage messages occupy less space and simplify how usage messages
are displayed.
2001-02-14 21:23:06 +00:00
Eric Andersen
af4ac77d9d Apply a patch from Larry Doolittle to add "-all" and "-none" switches
to multibuild.pl.  I did a little formatting adjustments to make it
_very_ obvious when things stop working.  I also removed the USE_PROCFS
config option -- just do the right thing when USE_DEVPS_PATCH is enabled.
 -Erik
2001-02-01 22:43:49 +00:00
Matt Kraai
f2cc2762bb Create find_applet_by_name function. Save 32 bytes. 2001-02-01 19:21:20 +00:00
Matt Kraai
dd19c69904 Removed trailing \n from error_msg{,_and_die} messages. 2001-01-31 19:00:21 +00:00
Eric Andersen
306f4fe480 If the ioctl fails to tell us the winsize, default to 79.
-Erik
2001-01-31 00:30:45 +00:00
Eric Andersen
22332fd26f Patch from Bryan Rittmeyer -- be more conservative by default
with the lash prompt.
 -Erik
2001-01-30 23:40:39 +00:00
Eric Andersen
4bbdd788e0 Fix the pwd and group functions. The bb_ stuff was a leftover from
a brief past that mercifully (except for this) never made it into CVS.
 -Erik
2001-01-30 22:23:17 +00:00
Eric Andersen
8ec10a9483 Fix up copyright msgs. Bump version to 0.49 in preparation for
a release.  Update the website with release details.
 -Erik
2001-01-27 09:33:39 +00:00
Eric Andersen
ab050f5522 Add in a patch to make busybox use the normal pwd.h and grp.h
functions.  Add in simple implementations of these functions,
which can, optionally, be used instead of the system versions.
 -Erik
2001-01-27 06:01:43 +00:00
Mark Whitley
4e33875759 Applied patch from Vladimir N. Oleynik <dzo@simtreas.ru> to do tab-completion
in Busybox shell.  (Thanks, Vlad.)
2001-01-26 20:42:23 +00:00
Mark Whitley
6e25f92636 Fixed a li'l thinko. 2001-01-26 19:19:23 +00:00
Mark Whitley
59ab025363 #define -> static const int. Also got rid of some big static buffers. 2001-01-23 22:30:04 +00:00
Eric Andersen
2b8d07c590 Bug fix. 2001-01-23 00:27:51 +00:00
Eric Andersen
6f65a3a7e8 More printf cleanups 2001-01-20 01:10:07 +00:00
Matt Kraai
12f417edbd Eliminate calls of the form "fprintf(stdout,". Thanks for the idea to
Vladimir N. Oleynik.
2001-01-18 02:57:08 +00:00
Eric Andersen
744b064a34 Needs to be NULL at init in all cases. 2001-01-05 21:23:44 +00:00
Eric Andersen
8ea28be6d2 Patch from larry doolittle to be ever so careful to cleanup
all open file descriptors, lest wierdness happen later.
2001-01-05 20:58:22 +00:00
Eric Andersen
0bcc813a34 Better label the globals. 2001-01-05 19:37:32 +00:00
Eric Andersen
b0970d4fed Patch from Larry Doolittle to set values to static variables that live in the
bss at runtime, since sh.c can call sh.c, which causes these variables to not
be set to their defaults as god intended.
 -Erik
2001-01-05 19:34:52 +00:00
Matt Kraai
defcd5e75e Fix a segfault by only constructing the prompt when we need to. If we don't
do this we will segfault processing /etc/.profile since cwd isn't yet set.
2001-01-05 02:53:11 +00:00
Eric Andersen
09acc06c10 Move window size handling to cmdedit.c. Move prompt setup to setup_prompt_string() 2001-01-04 11:10:38 +00:00
Eric Andersen
849083c886 Update interface per what now exists... 2001-01-04 11:09:00 +00:00
Eric Andersen
b3dc3b8990 Cleanup -- move win handling to cmdedit.c, static-ify many functions. 2001-01-04 11:08:45 +00:00
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