summaryrefslogtreecommitdiff
path: root/lisp/time-stamp.el
diff options
context:
space:
mode:
authorStephen Gildea <stepheng+emacs@gildea.com>2021-05-30 11:05:42 -0700
committerStephen Gildea <stepheng+emacs@gildea.com>2021-05-30 11:05:42 -0700
commita5b57fc6af7ec87c59d00a7631576f9f4bf99841 (patch)
tree2384eb75571f6a069938889362b2307dfd5f7350 /lisp/time-stamp.el
parentd6dc66053d846b6fc041889b4d0f383c8dac4da3 (diff)
downloademacs-a5b57fc6af7ec87c59d00a7631576f9f4bf99841.tar.gz
emacs-a5b57fc6af7ec87c59d00a7631576f9f4bf99841.tar.bz2
emacs-a5b57fc6af7ec87c59d00a7631576f9f4bf99841.zip
time-stamp: fix minor bug when parsing option combos
* lisp/time-stamp.el (time-stamp-string-preprocess): Handle digit options correctly to avoid overcounting colon options. * test/lisp/time-stamp-tests.el (time-stamp-format-time-zone-offset): Add a new test case that would have caught the option-parsing error.
Diffstat (limited to 'lisp/time-stamp.el')
-rw-r--r--lisp/time-stamp.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el
index 42455ddfe33..0cc566f0d8c 100644
--- a/lisp/time-stamp.el
+++ b/lisp/time-stamp.el
@@ -499,7 +499,8 @@ and all `time-stamp-format' compatibility."
(< ind fmt-len)))
(if (and (<= ?0 cur-char) (>= ?9 cur-char))
;; get format width
- (let ((field-index ind))
+ (let ((field-index ind)
+ (first-digit cur-char))
(while (progn
(setq ind (1+ ind))
(setq cur-char (if (< ind fmt-len)
@@ -510,6 +511,7 @@ and all `time-stamp-format' compatibility."
(setq field-width
(substring format field-index ind))
(setq ind (1- ind))
+ (setq cur-char first-digit)
t))))
(setq prev-char cur-char)
;; some characters we actually use