Browse Source

babel: number checking no longer fooled by strings ending in newlines

* contrib/babel/lisp/org-babel.el (org-babel-number-p): number
  checking is no longer fooled by strings ending in single newlines
Eric Schulte 15 years ago
parent
commit
efbb07fe12
1 changed files with 3 additions and 1 deletions
  1. 3 1
      contrib/babel/lisp/org-babel.el

+ 3 - 1
contrib/babel/lisp/org-babel.el

@@ -1289,7 +1289,9 @@ This is taken almost directly from `org-read-prop'."
 (defun org-babel-number-p (string)
   "Return t if STRING represents a number"
   (if (and (string-match "^-?[0-9]*\\.?[0-9]*$" string)
-           (= (match-end 0) (length string)))
+           (= (length (substring string (match-beginning 0)
+				 (match-end 0)))
+	      (length string)))
       (string-to-number string)))
 
 (defun org-babel-import-elisp-from-file (file-name)