From 0e3a193db6c0e9cc5d27cf2fcf45aa8a905ebf71 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 16 May 2026 16:49:47 +0530 Subject: [PATCH] macOS APIs are really really bonkers --- glfw/cocoa_window.m | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index 69856262d..2a9b805fe 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -1669,14 +1669,10 @@ send_data_available_event_on_next_event_loop_tick(GLFWid wid, const char *mime) static void create_uri_list(_GLFWDropData *d, NSArray *urls) { NSMutableArray *items = [NSMutableArray array]; - NSCharacterSet *c1 = [NSCharacterSet URLQueryAllowedCharacterSet]; - NSCharacterSet *c2 = [NSCharacterSet URLPathAllowedCharacterSet]; + NSCharacterSet *allowedChars = [NSCharacterSet URLQueryAllowedCharacterSet]; for (NSURL *url in urls) { NSCharacterSet *allowedChars = c1; - if ([url isFileURL]) { - url = [url filePathURL]; - allowedChars = c2; - } + if ([url isFileURL]) url = [url filePathURL]; NSString *absoluteString = url.absoluteString; NSString *q = [absoluteString stringByAddingPercentEncodingWithAllowedCharacters:allowedChars]; [items addObject:q];