MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / SortByNakedFilename

Function SortByNakedFilename

source/script2.cpp:6298–6315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6296
6297
6298int SortByNakedFilename(const void *a1, const void *a2)
6299// See comments in prior function for details.
6300{
6301 LPTSTR sort_item1 = *(LPTSTR *)a1;
6302 LPTSTR sort_item2 = *(LPTSTR *)a2;
6303 LPTSTR cp;
6304 if (cp = _tcsrchr(sort_item1, '\\')) // Assign
6305 sort_item1 = cp + 1;
6306 if (cp = _tcsrchr(sort_item2, '\\')) // Assign
6307 sort_item2 = cp + 1;
6308 // v1.0.43.03: Added support the new locale-insensitive mode.
6309 int result = (g_SortCaseSensitive != SCS_INSENSITIVE_LOGICAL)
6310 ? tcscmp2(sort_item1, sort_item2, g_SortCaseSensitive) // Resolve large macro only once for code size reduction.
6311 : StrCmpLogicalW(sort_item1, sort_item2);
6312 if (!result)
6313 result = (sort_item1 > sort_item2) ? 1 : -1; // Stable sort.
6314 return g_SortReverse ? -result : result;
6315}
6316
6317
6318

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected