diff options
Diffstat (limited to 'src/nsselect.m')
| -rw-r--r-- | src/nsselect.m | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/nsselect.m b/src/nsselect.m index a719eef4e86..6831090aa20 100644 --- a/src/nsselect.m +++ b/src/nsselect.m | |||
| @@ -565,6 +565,9 @@ ns_decode_data_to_pasteboard (Lisp_Object type, Lisp_Object data, | |||
| 565 | NSMutableArray *temp; | 565 | NSMutableArray *temp; |
| 566 | Lisp_Object tem; | 566 | Lisp_Object tem; |
| 567 | specpdl_ref count; | 567 | specpdl_ref count; |
| 568 | #if !NS_USE_NSPasteboardTypeFileURL | ||
| 569 | NSURL *url; | ||
| 570 | #endif | ||
| 568 | 571 | ||
| 569 | types = [pasteboard types]; | 572 | types = [pasteboard types]; |
| 570 | count = SPECPDL_INDEX (); | 573 | count = SPECPDL_INDEX (); |
| @@ -602,7 +605,12 @@ ns_decode_data_to_pasteboard (Lisp_Object type, Lisp_Object data, | |||
| 602 | [pasteboard setString: [NSString stringWithLispString: data] | 605 | [pasteboard setString: [NSString stringWithLispString: data] |
| 603 | forType: NSPasteboardTypeFileURL]; | 606 | forType: NSPasteboardTypeFileURL]; |
| 604 | #else | 607 | #else |
| 605 | [pasteboard setString: [NSString stringWithLispString: data] | 608 | url = [NSURL URLWithString: [NSString stringWithLispString: data]]; |
| 609 | |||
| 610 | if (!url) | ||
| 611 | signal_error ("Invalid file URL", data); | ||
| 612 | |||
| 613 | [pasteboard setString: [url path] | ||
| 606 | forType: NSFilenamesPboardType]; | 614 | forType: NSFilenamesPboardType]; |
| 607 | #endif | 615 | #endif |
| 608 | } | 616 | } |