aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
authorPo Lu2022-05-12 07:39:11 +0000
committerPo Lu2022-05-12 07:42:33 +0000
commit89c6e412dd6bcb3a8e5e90d9a52cf6f6fd233776 (patch)
treea0adc7a8843259cda881a56dc24137c522eec30e /src/image.c
parent0e5623b491cb4158d8055b9c2ee7963fee8c75de (diff)
downloademacs-89c6e412dd6bcb3a8e5e90d9a52cf6f6fd233776.tar.gz
emacs-89c6e412dd6bcb3a8e5e90d9a52cf6f6fd233776.zip
Fix searching the bitmap file path on Haiku
* src/image.c (image_create_bitmap_from_file): [HAVE_HAIKU]: Look for the bitmap inside `x-bitmap-file-path' as well.
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/image.c b/src/image.c
index 0c14173d833..dfa53279927 100644
--- a/src/image.c
+++ b/src/image.c
@@ -750,8 +750,28 @@ image_create_bitmap_from_file (struct frame *f, Lisp_Object file)
750 int fd, width, height, rc, bytes_per_line, x, y; 750 int fd, width, height, rc, bytes_per_line, x, y;
751 char *contents, *data, *tmp; 751 char *contents, *data, *tmp;
752 void *bitmap; 752 void *bitmap;
753 Lisp_Object found;
753 754
754 if (!STRINGP (image_find_image_fd (file, &fd))) 755 /* Look for an existing bitmap with the same name. */
756 for (id = 0; id < dpyinfo->bitmaps_last; ++id)
757 {
758 if (dpyinfo->bitmaps[id].refcount
759 && dpyinfo->bitmaps[id].file
760 && !strcmp (dpyinfo->bitmaps[id].file, SSDATA (file)))
761 {
762 ++dpyinfo->bitmaps[id].refcount;
763 return id + 1;
764 }
765 }
766
767 /* Search bitmap-file-path for the file, if appropriate. */
768 if (openp (Vx_bitmap_file_path, file, Qnil, &found,
769 make_fixnum (R_OK), false, false)
770 < 0)
771 return -1;
772
773 if (!STRINGP (image_find_image_fd (file, &fd))
774 && !STRINGP (image_find_image_fd (found, &fd)))
755 return -1; 775 return -1;
756 776
757 contents = slurp_file (fd, &size); 777 contents = slurp_file (fd, &size);