Prechádzať zdrojové kódy

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.
Kévin Le Gouguec 4 rokov pred
rodič
commit
6506ea1e05
1 zmenil súbory, kde vykonal 3 pridanie a 0 odobranie
  1. 3 0
      lisp/ob-C.el

+ 3 - 0
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)))