From: YAMAMOTO Mitsuharu Date: Sat, 24 Dec 2005 02:50:00 +0000 (+0000) Subject: [MAC_OS] (find_image_fsspec): Use coercion of Apple event data for X-Git-Tag: emacs-pretest-22.0.90~5093 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2d22e7edf2d46b0907d88dc8332b21fd3430c6e3;p=emacs.git [MAC_OS] (find_image_fsspec): Use coercion of Apple event data for translation from/to file names. --- diff --git a/src/image.c b/src/image.c index 8a6d40ae34f..579c04e6f46 100644 --- a/src/image.c +++ b/src/image.c @@ -2259,23 +2259,25 @@ find_image_fsspec (specified_file, file, fss) Lisp_Object specified_file, *file; FSSpec *fss; { -#if MAC_OSX - FSRef fsr; -#endif OSErr err; + AEDesc desc; *file = x_find_image_file (specified_file); if (!STRINGP (*file)) return fnfErr; /* file or directory not found; incomplete pathname */ /* Try to open the image file. */ -#if MAC_OSX - err = FSPathMakeRef (SDATA (*file), &fsr, NULL); + err = AECoercePtr (TYPE_FILE_NAME, SDATA (*file), + SBYTES (*file), typeFSS, &desc); if (err == noErr) - err = FSGetCatalogInfo (&fsr, kFSCatInfoNone, NULL, NULL, fss, NULL); + { +#if TARGET_API_MAC_CARBON + err = AEGetDescData (&desc, fss, sizeof (FSSpec)); #else - err = posix_pathname_to_fsspec (SDATA (*file), fss); + *fss = *(FSSpec *)(*(desc.dataHandle)); #endif + AEDisposeDesc (&desc); + } return err; }