Skip to content

Commit abb0676

Browse files
authored
Merge pull request #1 from ShikiSuen/copilot/investigate-pr-failure-windows
Fix Windows CI failure: Remove broken username validation in CFKnownLocations
2 parents 970da0e + 72e9aec commit abb0676

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ Build
3232
*.orig
3333
.arcconfig
3434
.swiftpm
35+
_codeql_detected_source_root

Sources/CoreFoundation/CFKnownLocations.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,7 @@ CFURLRef _Nullable _CFKnownLocationCreatePreferencesURLForUser(CFKnownLocationUs
9696
break;
9797
}
9898
case _kCFKnownLocationUserCurrent:
99-
username = CFGetUserName();
100-
// The above API returns a non-NULL CFStringRef. The failed result is an empty string.
101-
// We need to check for that case and fall through to the next case.
102-
Boolean isEmpty = CFEqual(username, CFSTR(""));
103-
CFRelease(username);
104-
if (!isEmpty) {
105-
break;
106-
}
107-
// fallthrough.
99+
// fallthrough
108100
case _kCFKnownLocationUserByName: {
109101
wchar_t* path = NULL;
110102
SHGetKnownFolderPath(&FOLDERID_LocalAppData, 0, NULL, &path);

0 commit comments

Comments
 (0)