* subr.el (read-number): Once more use `read'
authorGlenn Morris <rgm@gnu.org>
Wed, 24 Apr 2013 17:31:43 +0000 (10:31 -0700)
committerGlenn Morris <rgm@gnu.org>
Wed, 24 Apr 2013 17:31:43 +0000 (10:31 -0700)
rather than `string-to-number', to trap non-numeric input.

Fixes: debbugs:14254

lisp/ChangeLog
lisp/subr.el

index b1baa9d..2e0645e 100644 (file)
@@ -1,3 +1,8 @@
+2013-04-24  Glenn Morris  <rgm@gnu.org>
+
+       * 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  <erikcharlebois@gmail.com>
 
        * emacs-lisp/syntax.el (syntax-propertize-multiline):
index eef8c46..88f27c7 100644 (file)
@@ -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.")