diff options
author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-12-16 23:49:13 +0000 |
---|---|---|
committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-12-16 23:49:13 +0000 |
commit | 8037e89b2e9c5a485bd57f4fe40f4659c25ca7b9 (patch) | |
tree | 6dc013e44d2281eb1e6f61c4bca1ae7546001f79 /shell | |
parent | b0ba03e9b3d460154fd09ef5676c18bf0770fdce (diff) | |
download | busybox-w32-8037e89b2e9c5a485bd57f4fe40f4659c25ca7b9.tar.gz busybox-w32-8037e89b2e9c5a485bd57f4fe40f4659c25ca7b9.tar.bz2 busybox-w32-8037e89b2e9c5a485bd57f4fe40f4659c25ca7b9.zip |
inline strcmp(s, "-") [actually macro-ize it for now - gcc is too stupid]
git-svn-id: svn://busybox.net/trunk/busybox@16977 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 14 | ||||
-rw-r--r-- | shell/msh.c | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/shell/ash.c b/shell/ash.c index 3a9998fc0..8ba4cb8a0 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -2315,7 +2315,7 @@ cdcmd(int argc, char **argv) | |||
2315 | dest = *argptr; | 2315 | dest = *argptr; |
2316 | if (!dest) | 2316 | if (!dest) |
2317 | dest = bltinlookup(homestr); | 2317 | dest = bltinlookup(homestr); |
2318 | else if (dest[0] == '-' && dest[1] == '\0') { | 2318 | else if (LONE_DASH(dest)) { |
2319 | dest = bltinlookup("OLDPWD"); | 2319 | dest = bltinlookup("OLDPWD"); |
2320 | flags |= CD_PRINT; | 2320 | flags |= CD_PRINT; |
2321 | } | 2321 | } |
@@ -8889,7 +8889,7 @@ options(int cmdline) | |||
8889 | argptr++; | 8889 | argptr++; |
8890 | if ((c = *p++) == '-') { | 8890 | if ((c = *p++) == '-') { |
8891 | val = 1; | 8891 | val = 1; |
8892 | if (p[0] == '\0' || (p[0] == '-' && p[1] == '\0')) { | 8892 | if (p[0] == '\0' || LONE_DASH(p)) { |
8893 | if (!cmdline) { | 8893 | if (!cmdline) { |
8894 | /* "-" means turn off -x and -v */ | 8894 | /* "-" means turn off -x and -v */ |
8895 | if (p[0] == '\0') | 8895 | if (p[0] == '\0') |
@@ -9114,7 +9114,7 @@ atend: | |||
9114 | goto out; | 9114 | goto out; |
9115 | } | 9115 | } |
9116 | optnext++; | 9116 | optnext++; |
9117 | if (p[0] == '-' && p[1] == '\0') /* check for "--" */ | 9117 | if (LONE_DASH(p)) /* check for "--" */ |
9118 | goto atend; | 9118 | goto atend; |
9119 | } | 9119 | } |
9120 | 9120 | ||
@@ -9232,7 +9232,7 @@ nextopt(const char *optstring) | |||
9232 | if (p == NULL || *p != '-' || *++p == '\0') | 9232 | if (p == NULL || *p != '-' || *++p == '\0') |
9233 | return '\0'; | 9233 | return '\0'; |
9234 | argptr++; | 9234 | argptr++; |
9235 | if (p[0] == '-' && p[1] == '\0') /* check for "--" */ | 9235 | if (LONE_DASH(p)) /* check for "--" */ |
9236 | return '\0'; | 9236 | return '\0'; |
9237 | } | 9237 | } |
9238 | c = *p++; | 9238 | c = *p++; |
@@ -9825,7 +9825,7 @@ void fixredir(union node *n, const char *text, int err) | |||
9825 | 9825 | ||
9826 | if (is_digit(text[0]) && text[1] == '\0') | 9826 | if (is_digit(text[0]) && text[1] == '\0') |
9827 | n->ndup.dupfd = digit_val(text[0]); | 9827 | n->ndup.dupfd = digit_val(text[0]); |
9828 | else if (text[0] == '-' && text[1] == '\0') | 9828 | else if (LONE_DASH(text)) |
9829 | n->ndup.dupfd = -1; | 9829 | n->ndup.dupfd = -1; |
9830 | else { | 9830 | else { |
9831 | 9831 | ||
@@ -11650,7 +11650,7 @@ trapcmd(int argc, char **argv) | |||
11650 | sh_error("%s: bad trap", *ap); | 11650 | sh_error("%s: bad trap", *ap); |
11651 | INTOFF; | 11651 | INTOFF; |
11652 | if (action) { | 11652 | if (action) { |
11653 | if (action[0] == '-' && action[1] == '\0') | 11653 | if (LONE_DASH(action)) |
11654 | action = NULL; | 11654 | action = NULL; |
11655 | else | 11655 | else |
11656 | action = savestr(action); | 11656 | action = savestr(action); |
@@ -12257,7 +12257,7 @@ static void mklocal(char *name) | |||
12257 | 12257 | ||
12258 | INTOFF; | 12258 | INTOFF; |
12259 | lvp = ckmalloc(sizeof (struct localvar)); | 12259 | lvp = ckmalloc(sizeof (struct localvar)); |
12260 | if (name[0] == '-' && name[1] == '\0') { | 12260 | if (LONE_DASH(name)) { |
12261 | char *p; | 12261 | char *p; |
12262 | p = ckmalloc(sizeof(optlist)); | 12262 | p = ckmalloc(sizeof(optlist)); |
12263 | lvp->text = memcpy(p, optlist, sizeof(optlist)); | 12263 | lvp->text = memcpy(p, optlist, sizeof(optlist)); |
diff --git a/shell/msh.c b/shell/msh.c index 492d3cf43..45ca3df81 100644 --- a/shell/msh.c +++ b/shell/msh.c | |||
@@ -1001,7 +1001,7 @@ static int newfile(char *s) | |||
1001 | 1001 | ||
1002 | DBGPRINTF7(("NEWFILE: opening %s\n", s)); | 1002 | DBGPRINTF7(("NEWFILE: opening %s\n", s)); |
1003 | 1003 | ||
1004 | if (strcmp(s, "-") != 0) { | 1004 | if (NOT_LONE_DASH(s)) { |
1005 | DBGPRINTF(("NEWFILE: s is %s\n", s)); | 1005 | DBGPRINTF(("NEWFILE: s is %s\n", s)); |
1006 | f = open(s, 0); | 1006 | f = open(s, 0); |
1007 | if (f < 0) { | 1007 | if (f < 0) { |