The inline expansion of PRINC might contain escape characters that were improperly caught by c-inline itself

This commit is contained in:
Juan Jose Garcia Ripoll 2012-06-27 22:34:38 +02:00
parent d6a56f0596
commit eaae5d5245
2 changed files with 12 additions and 1 deletions

View file

@ -661,3 +661,14 @@
(cmperr "C-INLINE: Variable code exceeds number of arguments")))))
(otherwise
(write-char c *compiler-output1*))))))
(defun c-inline-safe-string (constant-string)
;; Produce a text representation of a string that can be used
;; in a C-INLINE form, without triggering the @ or # escape
;; characters
(c-filtered-string
(concatenate 'string
(loop for c across constant-string
when (member c '(#\# #\@))
collect c
collect c))))

View file

@ -50,7 +50,7 @@
(ffi:c-inline ,(list stream) (:object) :void
,(concatenate 'string
"ecl_princ_str("
(c-filtered-string value)
(c-inline-safe-string value)
",#0)")
:one-liner t)
,value))