From 59ae6c9e7f10706b686dc2778613af716fb4c553 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Fri, 22 Dec 2017 01:19:32 +0530 Subject: [PATCH] Replace xstricmp() with strcoll() --- README.md | 1 - nnn.c | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cd5afbe6..b3209a07 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,6 @@ Have fun with it! PRs are welcome. Check out [#1](https://github.com/jarun/nnn/i - Detailed file information - Media information (needs mediainfo or exiftool, if specified) - Ordering - - Numeric order (1, 2, ... 10, 11, ...) for numeric names - Sort by modification time, size - Convenience - Create, rename files and directories diff --git a/nnn.c b/nnn.c index 157fc974..99630d09 100644 --- a/nnn.c +++ b/nnn.c @@ -632,6 +632,7 @@ xdiraccess(char *path) return TRUE; } +#if 0 /* * We assume none of the strings are NULL. * @@ -639,6 +640,8 @@ xdiraccess(char *path) * E.g., the order '1, 10, 2' doesn't make sense to human eyes. * * If the absolute numeric values are same, we fallback to alphasort. + * + * NOTE: This API is replaced by strcoll(). */ static int xstricmp(char *s1, char *s2) @@ -731,6 +734,7 @@ xstricmp(char *s1, char *s2) return (int) (TOUPPER(*s1) - TOUPPER(*s2)); } +#endif /* Return the integer value of a char representing HEX */ static char @@ -842,7 +846,7 @@ entrycmp(const void *va, const void *vb) return -1; } - return xstricmp(pa->name, pb->name); + return strcoll(pa->name, pb->name); } /*