diff options
| author | Glenn Morris | 2013-04-24 10:31:43 -0700 |
|---|---|---|
| committer | Glenn Morris | 2013-04-24 10:31:43 -0700 |
| commit | e5271cf20c08ba88e5c91a9626c08022f9a5058c (patch) | |
| tree | d66663d64d84b5daf06faf9067cbfcb3da7e61a6 | |
| parent | 70203c2ec17efdb68b0873e4a62e2862a347e095 (diff) | |
| download | emacs-e5271cf20c08ba88e5c91a9626c08022f9a5058c.tar.gz emacs-e5271cf20c08ba88e5c91a9626c08022f9a5058c.zip | |
* subr.el (read-number): Once more use `read'
rather than `string-to-number', to trap non-numeric input.
Fixes: debbugs:14254
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/subr.el | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b1baa9d9e64..2e0645e5156 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-04-24 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * subr.el (read-number): Once more use `read' rather than | ||
| 4 | `string-to-number', to trap non-numeric input. (Bug#14254) | ||
| 5 | |||
| 1 | 2013-04-22 Erik Charlebois <erikcharlebois@gmail.com> | 6 | 2013-04-22 Erik Charlebois <erikcharlebois@gmail.com> |
| 2 | 7 | ||
| 3 | * emacs-lisp/syntax.el (syntax-propertize-multiline): | 8 | * emacs-lisp/syntax.el (syntax-propertize-multiline): |
diff --git a/lisp/subr.el b/lisp/subr.el index eef8c46c7d6..88f27c75764 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -2229,7 +2229,7 @@ The value of DEFAULT is inserted into PROMPT." | |||
| 2229 | (condition-case nil | 2229 | (condition-case nil |
| 2230 | (setq n (cond | 2230 | (setq n (cond |
| 2231 | ((zerop (length str)) default1) | 2231 | ((zerop (length str)) default1) |
| 2232 | ((stringp str) (string-to-number str)))) | 2232 | ((stringp str) (read str)))) |
| 2233 | (error nil))) | 2233 | (error nil))) |
| 2234 | (unless (numberp n) | 2234 | (unless (numberp n) |
| 2235 | (message "Please enter a number.") | 2235 | (message "Please enter a number.") |