diff options
Diffstat (limited to 'src/image.c')
| -rw-r--r-- | src/image.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/image.c b/src/image.c index 9b8b7d97bda..916edd502da 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -3276,19 +3276,16 @@ image_find_image_fd (Lisp_Object file, int *pfd) | |||
| 3276 | /* Try to find FILE in data-directory/images, then x-bitmap-file-path. */ | 3276 | /* Try to find FILE in data-directory/images, then x-bitmap-file-path. */ |
| 3277 | fd = openp (search_path, file, Qnil, &file_found, | 3277 | fd = openp (search_path, file, Qnil, &file_found, |
| 3278 | pfd ? Qt : make_fixnum (R_OK), false, false); | 3278 | pfd ? Qt : make_fixnum (R_OK), false, false); |
| 3279 | if (fd >= 0 || fd == -2) | 3279 | if (fd == -2) |
| 3280 | { | 3280 | { |
| 3281 | file_found = ENCODE_FILE (file_found); | 3281 | /* The file exists locally, but has a file name handler. |
| 3282 | if (fd == -2) | 3282 | (This happens, e.g., under Auto Image File Mode.) |
| 3283 | { | 3283 | 'openp' didn't open the file, so we should, because the |
| 3284 | /* The file exists locally, but has a file name handler. | 3284 | caller expects that. */ |
| 3285 | (This happens, e.g., under Auto Image File Mode.) | 3285 | Lisp_Object encoded_name = ENCODE_FILE (file_found); |
| 3286 | 'openp' didn't open the file, so we should, because the | 3286 | fd = emacs_open (SSDATA (encoded_name), O_RDONLY, 0); |
| 3287 | caller expects that. */ | ||
| 3288 | fd = emacs_open (SSDATA (file_found), O_RDONLY, 0); | ||
| 3289 | } | ||
| 3290 | } | 3287 | } |
| 3291 | else /* fd < 0, but not -2 */ | 3288 | else if (fd < 0) |
| 3292 | return Qnil; | 3289 | return Qnil; |
| 3293 | if (pfd) | 3290 | if (pfd) |
| 3294 | *pfd = fd; | 3291 | *pfd = fd; |
| @@ -3296,8 +3293,8 @@ image_find_image_fd (Lisp_Object file, int *pfd) | |||
| 3296 | } | 3293 | } |
| 3297 | 3294 | ||
| 3298 | /* Find image file FILE. Look in data-directory/images, then | 3295 | /* Find image file FILE. Look in data-directory/images, then |
| 3299 | x-bitmap-file-path. Value is the encoded full name of the file | 3296 | x-bitmap-file-path. Value is the full name of the file found, or |
| 3300 | found, or nil if not found. */ | 3297 | nil if not found. */ |
| 3301 | 3298 | ||
| 3302 | Lisp_Object | 3299 | Lisp_Object |
| 3303 | image_find_image_file (Lisp_Object file) | 3300 | image_find_image_file (Lisp_Object file) |