aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/macterm.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/src/macterm.c b/src/macterm.c
index c8fc77b20ff..1adbad9ddd7 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -68,7 +68,6 @@ Boston, MA 02110-1301, USA. */
68#include <errno.h> 68#include <errno.h>
69#include <setjmp.h> 69#include <setjmp.h>
70#include <sys/stat.h> 70#include <sys/stat.h>
71#include <sys/param.h>
72 71
73#include "charset.h" 72#include "charset.h"
74#include "coding.h" 73#include "coding.h"
@@ -8201,6 +8200,7 @@ extern void init_apple_event_handler P_ ((void));
8201extern void mac_find_apple_event_spec P_ ((AEEventClass, AEEventID, 8200extern void mac_find_apple_event_spec P_ ((AEEventClass, AEEventID,
8202 Lisp_Object *, Lisp_Object *, 8201 Lisp_Object *, Lisp_Object *,
8203 Lisp_Object *)); 8202 Lisp_Object *));
8203extern OSErr init_coercion_handler P_ ((void));
8204 8204
8205#if TARGET_API_MAC_CARBON 8205#if TARGET_API_MAC_CARBON
8206/* Drag and Drop */ 8206/* Drag and Drop */
@@ -9207,25 +9207,25 @@ mac_do_receive_drag (WindowPtr window, void *handlerRefCon,
9207 result = GetFlavorFlags (theDrag, theItem, flavorTypeHFS, &theFlags); 9207 result = GetFlavorFlags (theDrag, theItem, flavorTypeHFS, &theFlags);
9208 if (result == noErr) 9208 if (result == noErr)
9209 { 9209 {
9210#ifdef MAC_OSX 9210 OSErr err;
9211 FSRef fref; 9211 AEDesc desc;
9212#endif
9213 char unix_path_name[MAXPATHLEN];
9214 9212
9215 GetFlavorData (theDrag, theItem, flavorTypeHFS, &data, &size, 0L); 9213 err = GetFlavorData (theDrag, theItem, flavorTypeHFS,
9216#ifdef MAC_OSX 9214 &data, &size, 0L);
9217 /* Use Carbon routines, otherwise it converts the file name 9215 if (err == noErr)
9218 to /Macintosh HD/..., which is not correct. */ 9216 err = AECoercePtr (typeFSS, &data.fileSpec, sizeof (FSSpec),
9219 FSpMakeFSRef (&data.fileSpec, &fref); 9217 TYPE_FILE_NAME, &desc);
9220 if (! FSRefMakePath (&fref, unix_path_name, sizeof (unix_path_name))); 9218 if (err == noErr)
9221#else 9219 {
9222 if (fsspec_to_posix_pathname (&data.fileSpec, unix_path_name, 9220 Lisp_Object file;
9223 sizeof (unix_path_name) - 1) == noErr) 9221
9224#endif 9222 /* x-dnd functions expect undecoded filenames. */
9225 /* x-dnd functions expect undecoded filenames. */ 9223 file = make_uninit_string (AEGetDescDataSize (&desc));
9226 file_list = Fcons (make_unibyte_string (unix_path_name, 9224 err = AEGetDescData (&desc, SDATA (file), SBYTES (file));
9227 strlen (unix_path_name)), 9225 if (err == noErr)
9228 file_list); 9226 file_list = Fcons (file, file_list);
9227 AEDisposeDesc (&desc);
9228 }
9229 } 9229 }
9230 } 9230 }
9231 /* If there are items in the list, construct an event and post it to 9231 /* If there are items in the list, construct an event and post it to
@@ -9317,6 +9317,8 @@ main (void)
9317 9317
9318 init_environ (); 9318 init_environ ();
9319 9319
9320 init_coercion_handler ();
9321
9320 initialize_applescript (); 9322 initialize_applescript ();
9321 9323
9322 init_apple_event_handler (); 9324 init_apple_event_handler ();
@@ -10705,6 +10707,8 @@ mac_initialize ()
10705#endif /* USE_CARBON_EVENTS */ 10707#endif /* USE_CARBON_EVENTS */
10706 10708
10707#ifdef MAC_OSX 10709#ifdef MAC_OSX
10710 init_coercion_handler ();
10711
10708 init_apple_event_handler (); 10712 init_apple_event_handler ();
10709 10713
10710 if (!inhibit_window_system) 10714 if (!inhibit_window_system)