]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix quick-calc in C mode with hex values
authorOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Sat, 18 Nov 2017 10:29:41 +0000 (12:29 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 18 Nov 2017 10:29:41 +0000 (12:29 +0200)
* lisp/calc/calc-aent.el (math-read-token): Make sure the match
against "0[xX][0-9a-fA-F]+" is found at math-exp-pos.  See
http://lists.gnu.org/archive/html/emacs-devel/2017-11/msg00174.html
for the details.

Copyright-paperwork-exempt: yes

lisp/calc/calc-aent.el

index f70a6d0eb070dfc00b8b3695b9e151f054940fa8..997ac3d583f2d610ea40be4d355b2918757f044c 100644 (file)
@@ -728,7 +728,9 @@ in Calc algebraic input.")
                                                 math-exp-str (1- math-exp-pos))
                                   (1- math-exp-pos))))))
             (or (and (memq calc-language calc-lang-c-type-hex)
-                     (string-match "0[xX][0-9a-fA-F]+" math-exp-str math-exp-pos))
+                     (eq (string-match "0[xX][0-9a-fA-F]+" math-exp-str
+                                        math-exp-pos)
+                          math-exp-pos))
                 (string-match "_?\\([0-9]+.?0*@ *\\)?\\([0-9]+.?0*' *\\)?\\(0*\\([2-9]\\|1[0-4]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-dA-D.]+[eE][-+_]?[0-9]+\\|0*\\([2-9]\\|[0-2][0-9]\\|3[0-6]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-zA-Zα-ωΑ-Ω:.]+\\|[0-9]+:[0-9:]+\\|[0-9.]+\\([eE][-+_]?[0-9]+\\)?\"?\\)?"
                                math-exp-str math-exp-pos))
             (setq math-exp-token 'number