Merge branch 'toplevel_data_for_drag' of https://github.com/Safari77/kitty

This commit is contained in:
Kovid Goyal 2026-10-06 15:37:12 +05:30
commit ccd671c658
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -2443,8 +2443,10 @@ toplevel_data_for_drag(
if (fd < 0) abrt(errno, "failed to open directory for drag source item");
ri->top_level_parent_dir_fd_plus_one = fd + 1;
if (!ds.file_promises) {
char *new_url = as_file_url(ds.base_dir_for_remote_items, path, ri->dir_entry_name);
if (!new_url) abrt(ENOMEM, "failed to generate file URL for drag source item");
free(mi.uri_list[uri_item_idx]);
mi.uri_list[uri_item_idx] = as_file_url(ds.base_dir_for_remote_items, path, ri->dir_entry_name);
mi.uri_list[uri_item_idx] = new_url;
}
}
return add_payload(w, ri, has_more, payload, payload_sz, ri->top_level_parent_dir_fd_plus_one - 1);