Merge branch 'upstream-KWSys' into update-kwsys

# By KWSys Upstream
* upstream-KWSys:
  KWSys 2026-07-28 (b5fb218b)
This commit is contained in:
Brad King
2026-07-28 09:51:43 -04:00
3 changed files with 3 additions and 64 deletions
+2 -17
View File
@@ -1252,7 +1252,8 @@ bool SystemTools::DeleteRegistryValue(std::string const& key, KeyWOW64 view)
&hKey) != ERROR_SUCCESS) {
return false;
} else {
if (RegDeleteValue(hKey, (LPTSTR)valuename.c_str()) == ERROR_SUCCESS) {
if (RegDeleteValueW(hKey, Encoding::ToWide(valuename).c_str()) ==
ERROR_SUCCESS) {
RegCloseKey(hKey);
return true;
}
@@ -2728,22 +2729,6 @@ int SystemTools::Strucmp(char const* l, char const* r)
return lc - rc;
}
int SystemTools::Strnucmp(char const* l, char const* r, size_t n)
{
int lc;
int rc;
size_t count = 0;
do {
lc = kwsysString_tolower(*l++);
rc = kwsysString_tolower(*r++);
count++;
if (count >= n) {
return lc - rc;
}
} while (lc == rc && lc);
return lc - rc;
}
// return file's modified time
long int SystemTools::ModifiedTime(std::string const& filename)
{
+1 -8
View File
@@ -198,17 +198,10 @@ public:
char separator = '/',
bool isPath = false);
/**
* Perform a case-independent string comparison.
* Similar to POSIX's strcasecmp.
* Perform a case-independent string comparison
*/
static int Strucmp(char const* s1, char const* s2);
/**
* Perform a case-independent string comparison, but compares at most n
* characters. Similar to POSIX's strncasecmp.
*/
static int Strnucmp(char const* s1, char const* s2, size_t n);
/**
* Split a string on its newlines into multiple lines
* Return false only if the last line stored had no newline
-39
View File
@@ -1317,43 +1317,6 @@ static bool CheckSplitString()
return ret;
}
static bool CheckStringComparisons()
{
if (!(kwsys::SystemTools::Strucmp("", "") == 0))
return false;
if (!(kwsys::SystemTools::Strucmp("bob", "bob") == 0))
return false;
if (!(kwsys::SystemTools::Strucmp("bob", "BOB") == 0))
return false;
if (!(kwsys::SystemTools::Strucmp("bob1", "BoB2") < 0))
return false;
if (!(kwsys::SystemTools::Strucmp("bOb4", "Bob3") > 0))
return false;
if (!(kwsys::SystemTools::Strucmp("aaa", "aaaaaaaaa") < 0))
return false;
if (!(kwsys::SystemTools::Strucmp("aaaaaaaaa", "aaa") > 1))
return false;
if (!(kwsys::SystemTools::Strnucmp("", "", 0) == 0))
return false;
if (!(kwsys::SystemTools::Strnucmp("", "", 3000) == 0))
return false;
if (!(kwsys::SystemTools::Strnucmp("bob", "Bobby", 3) == 0))
return false;
if (!(kwsys::SystemTools::Strnucmp("Bob", "boBBy", 3) == 0))
return false;
if (!(kwsys::SystemTools::Strnucmp("bob", "Bobby", 3000) < 0))
return false;
if (!(kwsys::SystemTools::Strnucmp("bobbY", "BOB", 3000) > 0))
return false;
if (!(kwsys::SystemTools::Strnucmp("bobb", "Bobby", 5) < 0))
return false;
if (!(kwsys::SystemTools::Strnucmp("bobbY", "BOBb", 5) > 0))
return false;
return true;
}
int testSystemTools(int, char*[])
{
bool res = true;
@@ -1407,7 +1370,5 @@ int testSystemTools(int, char*[])
res &= CheckSplitString();
res &= CheckStringComparisons();
return res ? 0 : 1;
}