mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-14 21:32:49 -08:00
The inline expansion of PRINC might contain escape characters that were improperly caught by c-inline itself
This commit is contained in:
parent
d6a56f0596
commit
eaae5d5245
2 changed files with 12 additions and 1 deletions
|
|
@ -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))))
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue