mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-06 01:05:48 +02:00
macOS APIs are really really bonkers
This commit is contained in:
@@ -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<NSString *> *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];
|
||||
|
||||
Reference in New Issue
Block a user