Browse Source

Ignore case in version compare

master
Arun Prakash Jana 5 years ago
parent
commit
1b06828819
No known key found for this signature in database GPG Key ID: A75979F35C080412
1 changed files with 8 additions and 4 deletions
  1. +8
    -4
      src/nnn.c

+ 8
- 4
src/nnn.c View File

@@ -1310,8 +1310,10 @@ static int xstrverscmp(const char * const s1, const char * const s2)
if (p1 == p2) if (p1 == p2)
return 0; return 0;


c1 = *p1++;
c2 = *p2++;
c1 = TOUPPER(*p1);
++p1;
c2 = TOUPPER(*p2);
++p2;


/* Hint: '0' is a digit too. */ /* Hint: '0' is a digit too. */
state = S_N + ((c1 == '0') + (xisdigit(c1) != 0)); state = S_N + ((c1 == '0') + (xisdigit(c1) != 0));
@@ -1321,8 +1323,10 @@ static int xstrverscmp(const char * const s1, const char * const s2)
return diff; return diff;


state = next_state[state]; state = next_state[state];
c1 = *p1++;
c2 = *p2++;
c1 = TOUPPER(*p1);
++p1;
c2 = TOUPPER(*p2);
++p2;
state += (c1 == '0') + (xisdigit(c1) != 0); state += (c1 == '0') + (xisdigit(c1) != 0);
} }




Loading…
Cancel
Save