diff options
Diffstat (limited to '')
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/bltin/test.c | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog index 5804248..b22197f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2007-09-22 Oleg Verych <olecom@flower.upol.cz> * White space fixes for test(1). + * Use direct comparison instead of strcmp in test(1). 2007-09-22 Herbert Xu <herbert@gondor.apana.org.au> diff --git a/src/bltin/test.c b/src/bltin/test.c index fd24fae..7d49569 100644 --- a/src/bltin/test.c +++ b/src/bltin/test.c @@ -157,8 +157,8 @@ testcmd(int argc, char **argv) { int res; - if (strcmp(argv[0], "[") == 0) { - if (strcmp(argv[--argc], "]")) + if (*argv[0] == '[') { + if (*argv[--argc] != ']') error("missing ]"); argv[argc] = NULL; } |