Mercurial > emacs
comparison src/minibuf.c @ 6384:5e8a442a836d
(read_minibuf): Disallow trailing junk.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Wed, 16 Mar 1994 22:44:00 +0000 |
parents | a74524e1c961 |
children | 7491cbb3d1a3 |
comparison
equal
deleted
inserted
replaced
6383:62db5566c287 | 6384:5e8a442a836d |
---|---|
291 Fcons (last_minibuf_string, histval)); | 291 Fcons (last_minibuf_string, histval)); |
292 } | 292 } |
293 | 293 |
294 /* If Lisp form desired instead of string, parse it. */ | 294 /* If Lisp form desired instead of string, parse it. */ |
295 if (expflag) | 295 if (expflag) |
296 val = Fread (val); | 296 { |
297 Lisp_Object expr_and_pos; | |
298 unsigned char *p; | |
299 | |
300 expr_and_pos = Fread_from_string (val, Qnil, Qnil); | |
301 /* Ignore trailing whitespace; any other trailing junk is an error. */ | |
302 for (p = XSTRING (val)->data + XINT (Fcdr (expr_and_pos)); *p; p++) | |
303 if (*p != ' ' && *p != '\t' && *p != '\n') | |
304 error ("Trailing garbage following expression"); | |
305 val = Fcar (expr_and_pos); | |
306 } | |
297 | 307 |
298 unbind_to (count, Qnil); /* The appropriate frame will get selected | 308 unbind_to (count, Qnil); /* The appropriate frame will get selected |
299 in set-window-configuration. */ | 309 in set-window-configuration. */ |
300 | 310 |
301 UNGCPRO; | 311 UNGCPRO; |