summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Le Gouguec <kevin.legouguec@gmail.com>2020-05-28 11:09:18 +0200
committerKyle Meyer <kyle@kyleam.com>2020-05-28 22:32:30 -0400
commit6506ea1e059539a211dddd68fa0b6eba30b5e4ae (patch)
tree02df851cc60381aee20dbc63c28bfdae7b26071a
parentd73fd145c00e8c65da54a9b59224fbf22f9c6822 (diff)
downloadorg-mode-6506ea1e059539a211dddd68fa0b6eba30b5e4ae.tar.gz
Coerce symbols found in :includes header arguments to strings
Fix regression from 2020-05-24T16:23:26Z!brandon@guttersohn.org (commit 44cb98fdb), which broke test ob-C/string-var. * lisp/ob-C.el (org-babel-C-expand-C): Make sure items in :includes arguments are strings before performing string operations on them.
-rw-r--r--lisp/ob-C.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/lisp/ob-C.el b/lisp/ob-C.el
index c3e72c6..42c60c2 100644
--- a/lisp/ob-C.el
+++ b/lisp/ob-C.el
@@ -233,6 +233,9 @@ its header arguments."
;; includes
(mapconcat
(lambda (inc)
+ ;; :includes '(<foo> <bar>) gives us a list of
+ ;; symbols; convert those to strings.
+ (when (symbolp inc) (setq inc (symbol-name inc)))
(if (string-prefix-p "<" inc)
(format "#include %s" inc)
(format "#include \"%s\"" inc)))