[hackers] [sbase] expr: Don't interpret any arguments || sin
commit 504855ff96389b02fd92197792a7b26069cde593
Author: sin <sin_AT_2f30.org>
Date: Tue Apr 21 17:08:14 2015 +0100
expr: Don't interpret any arguments
expr -1 '<' 1 failed previously.
There is no need to have usage at all, any errors will be flagged
up as necessary further down.
diff --git a/expr.c b/expr.c
index 5e4f19d..608d9a8 100644
--- a/expr.c
+++ b/expr.c
_AT_@ -252,22 +252,12 @@ parse(char *expr[], int numexpr)
return (valp->str && *valp->str) || valp->num;
}
-static void
-usage(void)
-{
- enprintf(3, "usage: %s expression\n", argv0);
-}
-
int
main(int argc, char *argv[])
{
int ret;
- ARGBEGIN {
- default:
- usage();
- } ARGEND;
-
+ argv0 = argv[0], argc--, argv++;
ret = !parse(argv, argc);
enfshut(3, stdout, "<stdout>");
Received on Tue Apr 21 2015 - 18:09:26 CEST
This archive was generated by hypermail 2.3.0
: Tue Apr 21 2015 - 18:12:11 CEST