OSDN Git Service

FolderCompare: Make the sort order of file names including numbers the same as Explor...
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Wed, 11 May 2022 11:40:13 +0000 (20:40 +0900)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Wed, 11 May 2022 11:40:13 +0000 (20:40 +0900)
e.g.)
befere:
     file1.txt
     file100.txt
     file2.txt
after: ↓
     file1.txt
     file2.txt
     file100.txt

Src/DirViewColItems.cpp

index b8ebd7f..b66f512 100644 (file)
@@ -943,7 +943,9 @@ static int ColFileNameSort(const CDiffContext *pCtxt, const void *p, const void
                return -1;
        if (!ldi.diffcode.isDirectory() && rdi.diffcode.isDirectory())
                return 1;
-       return strutils::compare_nocase(ColFileNameGet<boost::flyweight<String> >(pCtxt, p, 0), ColFileNameGet<boost::flyweight<String> >(pCtxt, q, 0));
+       return StrCmpLogicalW(
+               ColFileNameGet<boost::flyweight<String>>(pCtxt, p, 0).get().c_str(),
+               ColFileNameGet<boost::flyweight<String>>(pCtxt, q, 0).get().c_str());
 }
 
 /**