summaryrefslogtreecommitdiff
path: root/string
diff options
context:
space:
mode:
Diffstat (limited to 'string')
-rw-r--r--string/Makefile2
-rw-r--r--string/strverscmp.c6
-rw-r--r--string/tst-svc.expect2
-rw-r--r--string/tst-svc.input2
4 files changed, 8 insertions, 4 deletions
diff --git a/string/Makefile b/string/Makefile
index 127e25fbd9..db9b5081d5 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -79,5 +79,5 @@ tests: $(objpfx)tst-svc.out
$(objpfx)tst-svc.out: tst-svc.input $(objpfx)tst-svc
GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
$(built-program-cmd) < $(word 1,$^) > $@
- -cmp tst-svc.expect $(objpfx)tst-svc.out
+ @cmp tst-svc.expect $(objpfx)tst-svc.out
endif
diff --git a/string/strverscmp.c b/string/strverscmp.c
index 2b7ebcb8a8..7c5be8dd95 100644
--- a/string/strverscmp.c
+++ b/string/strverscmp.c
@@ -74,7 +74,7 @@ __strverscmp (s1, s2)
unsigned char c1 = *p1++;
unsigned char c2 = *p2++;
/* Hint: '0' is a digit too. */
- int state = S_N | ((c1 == '0') + (isdigit (c1) != 0));
+ int state = S_N + ((c1 == '0') + (isdigit (c1) != 0));
int diff;
while ((diff = c1 - c2) == 0)
@@ -85,10 +85,10 @@ __strverscmp (s1, s2)
state = next_state[state];
c1 = *p1++;
c2 = *p2++;
- state |= (c1 == '0') + (isdigit (c1) != 0);
+ state += (c1 == '0') + (isdigit (c1) != 0);
}
- state = result_type[state * 3 | (((c2 == '0') + (isdigit (c2) != 0)))];
+ state = result_type[state * 3 + (((c2 == '0') + (isdigit (c2) != 0)))];
switch (state)
{
diff --git a/string/tst-svc.expect b/string/tst-svc.expect
index bb54a2ace0..6240112772 100644
--- a/string/tst-svc.expect
+++ b/string/tst-svc.expect
@@ -6,6 +6,8 @@
01a
0
0a
+2.6.20
+2.6.21
2.8
2.8-0.4
20
diff --git a/string/tst-svc.input b/string/tst-svc.input
index fbe06d2c87..247b1c48f9 100644
--- a/string/tst-svc.input
+++ b/string/tst-svc.input
@@ -6,6 +6,7 @@
01a
00a
000
+2.6.21
20
212
21
@@ -18,6 +19,7 @@ foo
foo-3.0.0
foo-3.0.1
foo-0.5
+2.6.20
foo-0.4b
foo-3.10
foo-3.2