and copynode() table implementations. Commit the fix but keep them disabled
until others check them out. Uncomment "//#define CMDTXT_TABLE",
"//#define CALCSIZE_TABLE", and "//#define COPYNODE_TABLE" to try them out.
Saves over 600 bytes on i386.
math suport, cleaner math syntax error checking, moves redundant signal
string tables (from kill and ash) into libbb and provides a few
cleanups elsewhere.
was written by Aaron Lehmann <aaronl@vitelus.com> for busybox. This
patch makes a few trivial changes to Aaron's code so that it can be
used (in theory) by the other shells as well...
-Erik
1) ping cleanup (compile fix from this patch already applied).
2) traceroute call not spare ntohl() now (and reduce size);
3) Fix for functions not declared static in insmod, ash, vi and mount.
4) a more simple API cmdedit :))
5) adds "stopped jobs" warning to ash on Ctrl-D and fixes "ignoreeof" option
6) reduce exporting library function index->strchr (traceroute), bzero->memset (syslogd)
handles all the basic stuff (for, case/esac, while, if/then/else), and
is very small (adds just 38k on x86). It is not as rigorously correct
about Bourne semantics as bash, but for most things it is quite
workable. There is still some work to be done to further shrink it (it
has its own globbing functions instead of using the libc ones, for
example), but it is quite usable as is.
-Erik
together by vodz, but uses newer sources, has the removed features
commented out instead of simply deleted (so they could be re-enabled)
and the builtins all work. This adds 72k.
-Erik
just be a simple command line interpreter with basic pipe, redirect, and job
control. For all the more fancy things, people should use hush or ash.
-Erik
Fixes the interaction between if/then/else/fi syntax and variables.
I planned to do it right from the beginning, but my implementation
was buggy. Also adds the relevant test cases. Also adds some old
Matt Kraai variable test cases that got left out somehow.
> 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.
$ 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
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.
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
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
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