mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
(str_verscmp): glibification.
Use g_ascii_isdigit() instead of isdigit(). Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
b5f465a3d8
commit
bc79d61b2d
@ -39,7 +39,6 @@
|
|||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#include <ctype.h>
|
|
||||||
#ifdef HAVE_STRVERSCMP
|
#ifdef HAVE_STRVERSCMP
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#endif /* HAVE_STRVERSCMP */
|
#endif /* HAVE_STRVERSCMP */
|
||||||
@ -122,7 +121,7 @@ str_verscmp (const char *s1, const char *s2)
|
|||||||
c1 = *p1++;
|
c1 = *p1++;
|
||||||
c2 = *p2++;
|
c2 = *p2++;
|
||||||
/* Hint: '0' is a digit too. */
|
/* Hint: '0' is a digit too. */
|
||||||
state = S_N + ((c1 == '0') + (isdigit (c1) != 0));
|
state = S_N + ((c1 == '0') + (g_ascii_isdigit (c1) ? 1 : 0));
|
||||||
|
|
||||||
while ((diff = c1 - c2) == 0)
|
while ((diff = c1 - c2) == 0)
|
||||||
{
|
{
|
||||||
@ -132,10 +131,10 @@ str_verscmp (const char *s1, const char *s2)
|
|||||||
state = next_state[state];
|
state = next_state[state];
|
||||||
c1 = *p1++;
|
c1 = *p1++;
|
||||||
c2 = *p2++;
|
c2 = *p2++;
|
||||||
state += (c1 == '0') + (isdigit (c1) != 0);
|
state += (c1 == '0') + (g_ascii_isdigit (c1) ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
state = result_type[state * 3 + (((c2 == '0') + (isdigit (c2) != 0)))];
|
state = result_type[state * 3 + (((c2 == '0') + (g_ascii_isdigit (c2) ? 1 : 0)))];
|
||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
@ -143,11 +142,11 @@ str_verscmp (const char *s1, const char *s2)
|
|||||||
return diff;
|
return diff;
|
||||||
|
|
||||||
case LEN:
|
case LEN:
|
||||||
while (isdigit (*p1++))
|
while (g_ascii_isdigit (*p1++))
|
||||||
if (!isdigit (*p2++))
|
if (!g_ascii_isdigit (*p2++))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return isdigit (*p2) ? -1 : diff;
|
return g_ascii_isdigit (*p2) ? -1 : diff;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
|
Loading…
Reference in New Issue
Block a user