Mercurial > hg > toybox
diff main.c @ 121:933766b0bd4b
Allow applets with optarg string NULL to use toy.optargs[].
author | Rob Landley <rob@landley.net> |
---|---|
date | Fri, 01 Jun 2007 13:41:24 -0400 |
parents | cc0a6789f92a |
children | ee49aa0dc731 |
line wrap: on
line diff
--- a/main.c Fri Jun 01 11:46:56 2007 -0400 +++ b/main.c Fri Jun 01 13:41:24 2007 -0400 @@ -58,18 +58,19 @@ toys.argv = argv; toys.exitval = 1; if (which->options) get_optflags(); + else toys.optargs = argv+1; } // Run a toy. void toy_exec(char *argv[]) { struct toy_list *which; - + which = toy_find(argv[0]); if (!which) return; toy_init(which, argv); - + exit(toys.which->toy_main()); }