diff options
Diffstat (limited to 'src/callint.c')
| -rw-r--r-- | src/callint.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/callint.c b/src/callint.c index 26b161a25b3..e09210f1bb6 100644 --- a/src/callint.c +++ b/src/callint.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Call a Lisp function interactively. | 1 | /* Call a Lisp function interactively. |
| 2 | Copyright (C) 1985-1986, 1993-1995, 1997, 2000-2011 | 2 | Copyright (C) 1985-1986, 1993-1995, 1997, 2000-2012 |
| 3 | Free Software Foundation, Inc. | 3 | Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| @@ -78,7 +78,7 @@ c -- Character (no input method is used). | |||
| 78 | C -- Command name: symbol with interactive function definition. | 78 | C -- Command name: symbol with interactive function definition. |
| 79 | d -- Value of point as number. Does not do I/O. | 79 | d -- Value of point as number. Does not do I/O. |
| 80 | D -- Directory name. | 80 | D -- Directory name. |
| 81 | e -- Parametrized event (i.e., one that's a list) that invoked this command. | 81 | e -- Parameterized event (i.e., one that's a list) that invoked this command. |
| 82 | If used more than once, the Nth `e' returns the Nth parameterized event. | 82 | If used more than once, the Nth `e' returns the Nth parameterized event. |
| 83 | This skips events that are integers or symbols. | 83 | This skips events that are integers or symbols. |
| 84 | f -- Existing file name. | 84 | f -- Existing file name. |
| @@ -274,8 +274,6 @@ invoke it. If KEYS is omitted or nil, the return value of | |||
| 274 | 274 | ||
| 275 | ptrdiff_t i, nargs; | 275 | ptrdiff_t i, nargs; |
| 276 | int foo; | 276 | int foo; |
| 277 | char prompt1[100]; | ||
| 278 | char *tem1; | ||
| 279 | int arg_from_tty = 0; | 277 | int arg_from_tty = 0; |
| 280 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; | 278 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; |
| 281 | int key_count; | 279 | int key_count; |
| @@ -339,7 +337,7 @@ invoke it. If KEYS is omitted or nil, the return value of | |||
| 339 | { | 337 | { |
| 340 | Lisp_Object input; | 338 | Lisp_Object input; |
| 341 | Lisp_Object funval = Findirect_function (function, Qt); | 339 | Lisp_Object funval = Findirect_function (function, Qt); |
| 342 | size_t events = num_input_events; | 340 | uintmax_t events = num_input_events; |
| 343 | input = specs; | 341 | input = specs; |
| 344 | /* Compute the arg values using the user's expression. */ | 342 | /* Compute the arg values using the user's expression. */ |
| 345 | GCPRO2 (input, filter_specs); | 343 | GCPRO2 (input, filter_specs); |
| @@ -491,13 +489,8 @@ invoke it. If KEYS is omitted or nil, the return value of | |||
| 491 | tem = string; | 489 | tem = string; |
| 492 | for (i = 1; *tem; i++) | 490 | for (i = 1; *tem; i++) |
| 493 | { | 491 | { |
| 494 | strncpy (prompt1, tem + 1, sizeof prompt1 - 1); | 492 | visargs[0] = make_string (tem + 1, strcspn (tem + 1, "\n")); |
| 495 | prompt1[sizeof prompt1 - 1] = 0; | 493 | if (strchr (SSDATA (visargs[0]), '%')) |
| 496 | tem1 = strchr (prompt1, '\n'); | ||
| 497 | if (tem1) *tem1 = 0; | ||
| 498 | |||
| 499 | visargs[0] = build_string (prompt1); | ||
| 500 | if (strchr (prompt1, '%')) | ||
| 501 | callint_message = Fformat (i, visargs); | 494 | callint_message = Fformat (i, visargs); |
| 502 | else | 495 | else |
| 503 | callint_message = visargs[0]; | 496 | callint_message = visargs[0]; |
| @@ -535,6 +528,8 @@ invoke it. If KEYS is omitted or nil, the return value of | |||
| 535 | message1_nolog ((char *) 0); | 528 | message1_nolog ((char *) 0); |
| 536 | /* Passing args[i] directly stimulates compiler bug */ | 529 | /* Passing args[i] directly stimulates compiler bug */ |
| 537 | teml = args[i]; | 530 | teml = args[i]; |
| 531 | /* See bug#8479. */ | ||
| 532 | if (! CHARACTERP (teml)) error ("Non-character input-event"); | ||
| 538 | visargs[i] = Fchar_to_string (teml); | 533 | visargs[i] = Fchar_to_string (teml); |
| 539 | break; | 534 | break; |
| 540 | 535 | ||