]> git.eshelyaron.com Git - emacs.git/commitdiff
icalendar.el: Fix parsing of sexp entries (bug#56241)
authorhokomo <hokomo@airmail.cc>
Thu, 24 Nov 2022 17:39:51 +0000 (18:39 +0100)
committerUlf Jasper <ulf.jasper@web.de>
Thu, 24 Nov 2022 17:59:58 +0000 (18:59 +0100)
* lisp/calendar/icalendar.el (icalendar--convert-sexp-to-ical): Use
read-from-string for parsing sexp entries (bug#56241).
Copyright-paperwork-exempt: yes

lisp/calendar/icalendar.el

index cf5429398971469befffd2c3e06d1bb670edb08c..557574004060f947a76c84d1d3ab0b8f0f418ff4 100644 (file)
@@ -1641,9 +1641,11 @@ enumeration, given as a Lisp time value -- used for test purposes."
                        entry-main)
          ;; regular sexp entry
          (icalendar--dmsg "diary-sexp %s" entry-main)
-         (let ((p1 (substring entry-main (match-beginning 1) (match-end 1)))
-               (p2 (substring entry-main (match-beginning 2) (match-end 2)))
-               (now (or start (current-time))))
+         (let* ((entry-main (substring entry-main 2))
+                (res (read-from-string entry-main))
+                (p1 (prin1-to-string (car res)))
+                (p2 (substring entry-main (cdr res)))
+                (now (or start (current-time))))
            (delete nil
                    (mapcar
                     (lambda (offset)