aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/image.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/image.c b/src/image.c
index 2e04685e7f9..b1d597d7213 100644
--- a/src/image.c
+++ b/src/image.c
@@ -11540,13 +11540,18 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
11540 return true; 11540 return true;
11541 11541
11542 rsvg_error: 11542 rsvg_error:
11543 if (err == NULL) 11543 if (!err || !err->message[0])
11544 image_error ("Error parsing SVG image"); 11544 image_error ("Error parsing SVG image");
11545 else 11545 else
11546 { 11546 {
11547 image_error ("Error parsing SVG image: %s", 11547 char *errmsg = err->message;
11548 call2 (Qstring_trim_right, build_string (err->message), 11548 ptrdiff_t errlen = strlen (errmsg);
11549 Qnil)); 11549
11550 /* Remove trailing whitespace from the error message text. It
11551 has a newline at the end, and perhaps more whitespace. */
11552 while (c_isspace (errmsg[errlen - 1]))
11553 errlen--;
11554 image_error ("Error parsing SVG image: %s", make_string (errmsg, errlen));
11550 g_error_free (err); 11555 g_error_free (err);
11551 } 11556 }
11552 11557
@@ -12272,6 +12277,4 @@ The options are:
12272 /* MagickExportImagePixels is in 6.4.6-9, but not 6.4.4-10. */ 12277 /* MagickExportImagePixels is in 6.4.6-9, but not 6.4.4-10. */
12273 imagemagick_render_type = 0; 12278 imagemagick_render_type = 0;
12274#endif 12279#endif
12275
12276 DEFSYM (Qstring_trim_right, "string-trim-right");
12277} 12280}