* read.c (find_percent_cached): Use strchr instead of STOP_SET
to find % or nul.
* makeint.h (MAP_PERCENT): Remove.
* main.c (initialize_stopchar_map): Remove.
stopchar_map[(int)';'] = MAP_SEMI;
stopchar_map[(int)'='] = MAP_EQUALS;
stopchar_map[(int)':'] = MAP_COLON;
- stopchar_map[(int)'%'] = MAP_PERCENT;
stopchar_map[(int)'|'] = MAP_PIPE;
stopchar_map[(int)'.'] = MAP_DOT | MAP_USERFUNC;
stopchar_map[(int)','] = MAP_COMMA;
#define MAP_SEMI 0x0010
#define MAP_EQUALS 0x0020
#define MAP_COLON 0x0040
-#define MAP_PERCENT 0x0080
#define MAP_PIPE 0x0100
#define MAP_DOT 0x0200
#define MAP_COMMA 0x0400
while (1)
{
- while (! STOP_SET (*p, MAP_PERCENT|MAP_NUL))
- ++p;
+ p = strchr(p, '%');
- if (*p == '\0')
+ if (!p)
break;
/* See if this % is escaped with a backslash; if not we're done. */
if (new)
{
*string = strcache_add (*string);
- p = *string + (p - new);
+ if (p)
+ p = *string + (p - new);
}
/* If we didn't find a %, return NULL. Otherwise return a ptr to it. */
- return (*p == '\0') ? NULL : p;
+ return p;
}
\f
/* Find the next line of text in an eval buffer, combining continuation lines