diff options
| author | Eli Zaretskii | 2015-10-19 16:15:30 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2015-10-19 16:15:30 +0300 |
| commit | 52b977006031a32891f4d3eb96971d72c625f780 (patch) | |
| tree | 8ee5480bf28c791337c0239c8e3ccdf0949157bc /src/image.c | |
| parent | f1575763c0d30df9f9e5b730c2f2c68f501cda9c (diff) | |
| download | emacs-52b977006031a32891f4d3eb96971d72c625f780.tar.gz emacs-52b977006031a32891f4d3eb96971d72c625f780.zip | |
Resurrect image loading under auto-image-file-mode
* src/image.c (x_find_image_fd): Handle the case of -2 returned by
'openp' specially. This special case was lost in the changes on
2015-08-18. (Bug#21685)
Diffstat (limited to 'src/image.c')
| -rw-r--r-- | src/image.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/image.c b/src/image.c index c702782b64b..9970e5881e0 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -2292,7 +2292,19 @@ x_find_image_fd (Lisp_Object file, int *pfd) | |||
| 2292 | /* Try to find FILE in data-directory/images, then x-bitmap-file-path. */ | 2292 | /* Try to find FILE in data-directory/images, then x-bitmap-file-path. */ |
| 2293 | fd = openp (search_path, file, Qnil, &file_found, | 2293 | fd = openp (search_path, file, Qnil, &file_found, |
| 2294 | pfd ? Qt : make_number (R_OK), false); | 2294 | pfd ? Qt : make_number (R_OK), false); |
| 2295 | if (fd < 0) | 2295 | if (fd >= 0 || fd == -2) |
| 2296 | { | ||
| 2297 | file_found = ENCODE_FILE (file_found); | ||
| 2298 | if (fd == -2) | ||
| 2299 | { | ||
| 2300 | /* The file exists locally, but has a file handler. (This | ||
| 2301 | happens, e.g., under Auto Image File Mode.) 'openp' | ||
| 2302 | didn't open the file, so we should, because the caller | ||
| 2303 | expects that. */ | ||
| 2304 | fd = emacs_open (SSDATA (file_found), O_RDONLY | O_BINARY, 0); | ||
| 2305 | } | ||
| 2306 | } | ||
| 2307 | else /* fd < 0, but not -2 */ | ||
| 2296 | return Qnil; | 2308 | return Qnil; |
| 2297 | if (pfd) | 2309 | if (pfd) |
| 2298 | *pfd = fd; | 2310 | *pfd = fd; |