Mercurial > hg > toybox
changeset 659:f142928f144a
Roy Tam pointed out that sh.c didn't get fully converted.
author | Rob Landley <rob@landley.net> |
---|---|
date | Mon, 27 Aug 2012 05:25:50 -0500 |
parents | 2b957eaa00c7 |
children | 760494af5163 |
files | toys/posix/sh.c |
diffstat | 1 files changed, 15 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/toys/posix/sh.c Sun Aug 26 21:17:00 2012 -0500 +++ b/toys/posix/sh.c Mon Aug 27 05:25:50 2012 -0500 @@ -185,14 +185,14 @@ #define TT this.sh // A single executable, its arguments, and other information we know about it. -#define TOYSH_FLAG_EXIT 1 -#define TOYSH_FLAG_SUSPEND 2 -#define TOYSH_FLAG_PIPE 4 -#define TOYSH_FLAG_AND 8 -#define TOYSH_FLAG_OR 16 -#define TOYSH_FLAG_AMP 32 -#define TOYSH_FLAG_SEMI 64 -#define TOYSH_FLAG_PAREN 128 +#define SH_FLAG_EXIT 1 +#define SH_FLAG_SUSPEND 2 +#define SH_FLAG_PIPE 4 +#define SH_FLAG_AND 8 +#define SH_FLAG_OR 16 +#define SH_FLAG_AMP 32 +#define SH_FLAG_SEMI 64 +#define SH_FLAG_PAREN 128 // What we know about a single process. struct command { @@ -221,7 +221,7 @@ char *end; // Detect end of line (and truncate line at comment) - if (CFG_TOYSH_PIPES && strchr("><&|(;", *start)) return 0; + if (CFG_SH_PIPES && strchr("><&|(;", *start)) return 0; // Grab next word. (Add dequote and envvar logic here) end = start; @@ -247,7 +247,7 @@ if (!cmdline) return 0; - if (CFG_TOYSH_JOBCTL) line->cmdline = cmdline; + if (CFG_SH_JOBCTL) line->cmdline = cmdline; // Parse command into argv[] for (;;) { @@ -256,7 +256,7 @@ // Skip leading whitespace and detect end of line. while (isspace(*start)) start++; if (!*start || *start=='#') { - if (CFG_TOYSH_JOBCTL) line->cmdlinelen = start-cmdline; + if (CFG_SH_JOBCTL) line->cmdlinelen = start-cmdline; return 0; } @@ -268,7 +268,7 @@ // If we hit the end of this command, how did it end? if (!end) { - if (CFG_TOYSH_PIPES && *start) { + if (CFG_SH_PIPES && *start) { if (*start==';') { start++; break; @@ -280,7 +280,7 @@ start = end; } - if (CFG_TOYSH_JOBCTL) line->cmdlinelen = start-cmdline; + if (CFG_SH_JOBCTL) line->cmdlinelen = start-cmdline; return start; } @@ -313,7 +313,7 @@ if (!cmd->pid) xexec(cmd->argv); else waitpid(cmd->pid, &status, 0); - if (CFG_TOYSH_FLOWCTL || CFG_TOYSH_PIPES) { + if (CFG_SH_FLOWCTL || CFG_SH_PIPES) { if (WIFEXITED(status)) cmd->pid = WEXITSTATUS(status); if (WIFSIGNALED(status)) cmd->pid = WTERMSIG(status); } @@ -370,7 +370,7 @@ FILE *f; // Set up signal handlers and grab control of this tty. - if (CFG_TOYSH_TTY) { + if (CFG_SH_TTY) { if (isatty(0)) toys.optflags |= 1; } f = *toys.optargs ? xfopen(*toys.optargs, "r") : NULL;