diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-03-11 12:16:25 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-03-11 12:16:25 +0000 |
commit | 1b5312d5c01fd5e12b938cfe65cda562e822619d (patch) | |
tree | 60f086613e97aae5cb2635b8b9e3251c7b3c55cf /src/skaembutils/s6-test.c | |
parent | ac77200b30d6c8bbe9093655dd0f8d8bf6e88feb (diff) | |
download | s6-portable-utils-1b5312d5c01fd5e12b938cfe65cda562e822619d.tar.xz |
Adapt to skalibs-2.5.0.0
Diffstat (limited to 'src/skaembutils/s6-test.c')
-rw-r--r-- | src/skaembutils/s6-test.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/skaembutils/s6-test.c b/src/skaembutils/s6-test.c index 36b7b15..d2d3b76 100644 --- a/src/skaembutils/s6-test.c +++ b/src/skaembutils/s6-test.c @@ -1,11 +1,9 @@ /* ISC license. */ -#include <sys/types.h> #include <sys/stat.h> #include <unistd.h> -#include <skalibs/uint.h> -#include <skalibs/bytestr.h> -#include <skalibs/fmtscan.h> +#include <string.h> +#include <skalibs/types.h> #include <skalibs/strerr2.h> #include <skalibs/env.h> #include <skalibs/djbunix.h> @@ -124,14 +122,14 @@ static unsigned int lex (struct node *tree, char const *const *argv) { "-v", T_ENV, 2 }, { 0, 0, 0 } } ; - register unsigned int pos = 0 ; + unsigned int pos = 0 ; for (; argv[pos] ; pos++) { unsigned int i = 0 ; tree[pos].data = argv[pos] ; for (i = 0 ; tokens[i].string ; i++) - if (!str_diff(argv[pos], tokens[i].string)) + if (!strcmp(argv[pos], tokens[i].string)) { tree[pos].op = tokens[i].op ; tree[pos].type = tokens[i].type ; @@ -433,17 +431,17 @@ static int run (struct node const *tree, unsigned int root) case T_ZERO : return !tree[tree[root].arg1].data[0] ; case T_STREQUAL : - return !str_diff(tree[tree[root].arg1].data, tree[tree[root].arg2].data) ; + return !strcmp(tree[tree[root].arg1].data, tree[tree[root].arg2].data) ; case T_STRNEQUAL : - return !!str_diff(tree[tree[root].arg1].data, tree[tree[root].arg2].data) ; + return !!strcmp(tree[tree[root].arg1].data, tree[tree[root].arg2].data) ; case T_STRLESSER : - return str_diff(tree[tree[root].arg1].data, tree[tree[root].arg2].data) < 0 ; + return strcmp(tree[tree[root].arg1].data, tree[tree[root].arg2].data) < 0 ; case T_STRLESSERE : - return str_diff(tree[tree[root].arg1].data, tree[tree[root].arg2].data) <= 0 ; + return strcmp(tree[tree[root].arg1].data, tree[tree[root].arg2].data) <= 0 ; case T_STRGREATER : - return str_diff(tree[tree[root].arg1].data, tree[tree[root].arg2].data) > 0 ; + return strcmp(tree[tree[root].arg1].data, tree[tree[root].arg2].data) > 0 ; case T_STRGREATERE : - return str_diff(tree[tree[root].arg1].data, tree[tree[root].arg2].data) >= 0 ; + return strcmp(tree[tree[root].arg1].data, tree[tree[root].arg2].data) >= 0 ; case T_NUMEQUAL : { int n1, n2 ; |