aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-04-01 21:11:23 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-04-01 21:11:23 +0530
commit1b06828819cce7e67dc620c38554574e25035f1c (patch)
tree1f1fdd2b401abc5e72e3786252106d2a6ec438ef /src/nnn.c
parent4cce8774492ee69fe9e3ba466828285e187a9b5e (diff)
downloadnnn-1b06828819cce7e67dc620c38554574e25035f1c.tar.gz
Ignore case in version compare
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 6ea7a03..46a07c3 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -1310,8 +1310,10 @@ static int xstrverscmp(const char * const s1, const char * const s2)
if (p1 == p2)
return 0;
- c1 = *p1++;
- c2 = *p2++;
+ c1 = TOUPPER(*p1);
+ ++p1;
+ c2 = TOUPPER(*p2);
+ ++p2;
/* Hint: '0' is a digit too. */
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;
state = next_state[state];
- c1 = *p1++;
- c2 = *p2++;
+ c1 = TOUPPER(*p1);
+ ++p1;
+ c2 = TOUPPER(*p2);
+ ++p2;
state += (c1 == '0') + (xisdigit(c1) != 0);
}