From: Glenn Morris Date: Wed, 24 Apr 2013 17:31:43 +0000 (-0700) Subject: * subr.el (read-number): Once more use `read' X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1943^2~23 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e5271cf20c08ba88e5c91a9626c08022f9a5058c;p=emacs.git * subr.el (read-number): Once more use `read' rather than `string-to-number', to trap non-numeric input. Fixes: debbugs:14254 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b1baa9d9e64..2e0645e5156 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-04-24 Glenn Morris + + * subr.el (read-number): Once more use `read' rather than + `string-to-number', to trap non-numeric input. (Bug#14254) + 2013-04-22 Erik Charlebois * 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." (condition-case nil (setq n (cond ((zerop (length str)) default1) - ((stringp str) (string-to-number str)))) + ((stringp str) (read str)))) (error nil))) (unless (numberp n) (message "Please enter a number.")