Commit 8acd16de authored by Karl Heuer's avatar Karl Heuer
Browse files

(read_minibuf): Disallow trailing junk.

parent 3ace87e3
......@@ -293,7 +293,17 @@ read_minibuf (map, initial, prompt, backup_n, expflag, histvar, histpos)
/* If Lisp form desired instead of string, parse it. */
if (expflag)
val = Fread (val);
{
Lisp_Object expr_and_pos;
unsigned char *p;
expr_and_pos = Fread_from_string (val, Qnil, Qnil);
/* Ignore trailing whitespace; any other trailing junk is an error. */
for (p = XSTRING (val)->data + XINT (Fcdr (expr_and_pos)); *p; p++)
if (*p != ' ' && *p != '\t' && *p != '\n')
error ("Trailing garbage following expression");
val = Fcar (expr_and_pos);
}
unbind_to (count, Qnil); /* The appropriate frame will get selected
in set-window-configuration. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment