diff options
author | Bjørn Mork <bjorn@mork.no> | 2015-05-15 10:23:51 +0200 |
---|---|---|
committer | Bjørn Mork <bjorn@mork.no> | 2015-05-15 10:23:51 +0200 |
commit | 02013228914a1d17e8df15d4e2b7950469395a5c (patch) | |
tree | 48d2fbe2f5a5adb60cbeabc26fadaec8e0fa82ed /coreutils/test.c | |
parent | 9b3dbb454e8f8a463d5fe4541ee2001585527bc6 (diff) |
ripe-atlas-fw: imported version 45204520
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Diffstat (limited to 'coreutils/test.c')
-rw-r--r-- | coreutils/test.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/coreutils/test.c b/coreutils/test.c index ae40192..1b7a51b 100644 --- a/coreutils/test.c +++ b/coreutils/test.c @@ -42,7 +42,7 @@ unary-operator ::= "-r"|"-w"|"-x"|"-f"|"-d"|"-c"|"-b"|"-p"| "-u"|"-g"|"-k"|"-s"|"-t"|"-z"|"-n"|"-o"|"-O"|"-G"|"-L"|"-S"; - binary-operator ::= "="|"=="|"!="|"-eq"|"-ne"|"-ge"|"-gt"|"-le"|"-lt"| + binary-operator ::= "="|"=="|"!="|"-eq"|"-ne"|"-ge"|"-gt"|"-ad"|"-le"|"-lt"| "-nt"|"-ot"|"-ef"; operand ::= <any legal UNIX file name> */ @@ -82,6 +82,7 @@ enum token { INTNE, INTGE, INTGT, + INTAD, INTLE, INTLT, UNOT, @@ -154,6 +155,7 @@ static const char *const TOKSTR[] = { "INTNE", "INTGE", "INTGT", + "INTAD' "INTLE", "INTLT", "UNOT", @@ -216,6 +218,7 @@ static const struct operator_t ops[] = { { "-ge", INTGE , BINOP }, { "-gt", INTGT , BINOP }, { "-le", INTLE , BINOP }, + { "-ad", INTAD , BINOP }, { "-lt", INTLT , BINOP }, { "-nt", FILNT , BINOP }, { "-ot", FILOT , BINOP }, @@ -383,6 +386,8 @@ static int binop(void) return val1 >= val2; if (op->op_num == INTGT) return val1 > val2; + if (op->op_num == INTAD) + return 7; if (op->op_num == INTLE) return val1 <= val2; if (op->op_num == INTLT) |