X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fstrverscmp.c;h=c138df53283f550df035f0a985bdfe50e01552a0;hb=ea12546cdee0548bded92ecffcf257aa5b6a125f;hp=f8f5193ebac07e9221e940b451864ef09092b177;hpb=bf156c40d271f02bc0e6bde8686c33870b7898cc;p=gnulib.git diff --git a/lib/strverscmp.c b/lib/strverscmp.c index f8f5193eb..c138df532 100644 --- a/lib/strverscmp.c +++ b/lib/strverscmp.c @@ -18,6 +18,10 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#if HAVE_CONFIG_H +# include +#endif + #include #include @@ -67,11 +71,11 @@ strverscmp (s1, s2) /* S_N */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, - /* S_I */ CMP, -1, -1, CMP, +1, LEN, LEN, CMP, - +1, LEN, LEN, CMP, CMP, CMP, CMP, CMP, + /* S_I */ CMP, -1, -1, CMP, 1, LEN, LEN, CMP, + 1, LEN, LEN, CMP, CMP, CMP, CMP, CMP, /* S_F */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, - /* S_Z */ CMP, +1, +1, CMP, -1, CMP, CMP, CMP, + /* S_Z */ CMP, 1, 1, CMP, -1, CMP, CMP, CMP, -1, CMP, CMP, CMP }; @@ -81,7 +85,7 @@ strverscmp (s1, s2) c1 = *p1++; c2 = *p2++; /* Hint: '0' is a digit too. */ - state = S_N | (c1 == '0') + (isdigit (c1) != 0); + state = S_N | ((c1 == '0') + (isdigit (c1) != 0)); while ((diff = c1 - c2) == 0 && c1 != '\0') {