From 41bd25b72422e6932ad7181496791e5cf9d79e9d Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Thu, 8 Jan 2009 15:35:32 +0100 Subject: [PATCH] Bugfix: Protect string-match against nil string. Friedrich Delgado Friedrichs writes: A while ago I had this problem: org-infojs-handle-options: Wrong type argument: stringp, nil I wonder if my patch ever reached the mailing list, or if it was overlooked because it was too close to christmas: Friedrich Delgado Friedrichs schrieb: From 0fef25f56c837ae9f434449c6f30268e0474f7ab Mon Sep 17 00:00:00 2001 From: Friedrich Delgado Friedrichs Date: Tue, 23 Dec 2008 12:10:42 +0100 Subject: [PATCH] fix string-match against nil when no in-file options are set for jsinfo --- lisp/org-jsinfo.el | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lisp/org-jsinfo.el b/lisp/org-jsinfo.el index 8f2d7e8..19faa9e 100644 --- a/lisp/org-jsinfo.el +++ b/lisp/org-jsinfo.el @@ -140,7 +140,8 @@ Option settings will replace the %MANAGER-OPTIONS cookie." default (cdr (assoc opt org-infojs-options))) (and (symbolp default) (not (memq default '(t nil))) (setq default (plist-get exp-plist default))) - (if (string-match (format " %s:\\(\\S-+\\)" opt) v) + (if (and v + (string-match (format " %s:\\(\\S-+\\)" opt) v)) (setq val (match-string 1 v)) (setq val default)) (cond --- lisp/ChangeLog | 3 +++ lisp/org-jsinfo.el | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index caeccf832..6b9c939f1 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2009-01-08 Carsten Dominik + * org-jsinfo.el (org-infojs-handle-options): Catch the case if v + is nil. + * org-exp.el (org-export-normalize-links): Protect the main link, to avoid special character processing. diff --git a/lisp/org-jsinfo.el b/lisp/org-jsinfo.el index 5fead0528..75f490907 100644 --- a/lisp/org-jsinfo.el +++ b/lisp/org-jsinfo.el @@ -140,7 +140,7 @@ Option settings will replace the %MANAGER-OPTIONS cookie." default (cdr (assoc opt org-infojs-options))) (and (symbolp default) (not (memq default '(t nil))) (setq default (plist-get exp-plist default))) - (if (string-match (format " %s:\\(\\S-+\\)" opt) v) + (if (and v (string-match (format " %s:\\(\\S-+\\)" opt) v)) (setq val (match-string 1 v)) (setq val default)) (cond -- 2.11.4.GIT