X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/d14c81eec79c626f017e015c7ecf24d7662504bc..17e0445be4a6a4f437f4be4924074c90d6477481:/src/image.c diff --git a/src/image.c b/src/image.c index fca1bb077f..167ee2da30 100644 --- a/src/image.c +++ b/src/image.c @@ -1521,7 +1521,7 @@ clear_image_cache (struct frame *f, Lisp_Object filter) clear_current_matrices (fr); } - ++windows_or_buffers_changed; + windows_or_buffers_changed = 19; } unblock_input (); @@ -3026,13 +3026,13 @@ xbm_load (struct frame *f, struct image *img) if (STRINGP (line)) memcpy (p, SDATA (line), nbytes); else - memcpy (p, XBOOL_VECTOR (line)->data, nbytes); + memcpy (p, bool_vector_data (line), nbytes); } } else if (STRINGP (data)) bits = SSDATA (data); else - bits = (char *) XBOOL_VECTOR (data)->data; + bits = (char *) bool_vector_data (data); #ifdef HAVE_NTGUI { @@ -5106,6 +5106,27 @@ pbm_image_p (Lisp_Object object) } +/* Get next char skipping comments in Netpbm header. Returns -1 at + end of input. */ + +static int +pbm_next_char (unsigned char **s, unsigned char *end) +{ + int c = -1; + + while (*s < end && (c = *(*s)++, c == '#')) + { + /* Skip to the next line break. */ + while (*s < end && (c = *(*s)++, c != '\n' && c != '\r')) + ; + + c = -1; + } + + return c; +} + + /* Scan a decimal number from *S and return it. Advance *S while reading the number. END is the end of the string. Value is -1 at end of input. */ @@ -5115,28 +5136,16 @@ pbm_scan_number (unsigned char **s, unsigned char *end) { int c = 0, val = -1; - while (*s < end) - { - /* Skip white-space. */ - while (*s < end && (c = *(*s)++, c_isspace (c))) - ; + /* Skip white-space. */ + while ((c = pbm_next_char (s, end)) != -1 && c_isspace (c)) + ; - if (c == '#') - { - /* Skip comment to end of line. */ - while (*s < end && (c = *(*s)++, c != '\n')) - ; - } - else if (c_isdigit (c)) - { - /* Read decimal number. */ - val = c - '0'; - while (*s < end && (c = *(*s)++, c_isdigit (c))) - val = 10 * val + c - '0'; - break; - } - else - break; + if (c_isdigit (c)) + { + /* Read decimal number. */ + val = c - '0'; + while ((c = pbm_next_char (s, end)) != -1 && c_isdigit (c)) + val = 10 * val + c - '0'; } return val; @@ -9493,7 +9502,7 @@ A cross is always drawn on black & white displays. */); DEFVAR_LISP ("x-bitmap-file-path", Vx_bitmap_file_path, doc: /* List of directories to search for window system bitmap files. */); - Vx_bitmap_file_path = decode_env_path (0, PATH_BITMAPS); + Vx_bitmap_file_path = decode_env_path (0, PATH_BITMAPS, 0); DEFVAR_LISP ("image-cache-eviction-delay", Vimage_cache_eviction_delay, doc: /* Maximum time after which images are removed from the cache.