Opened 6 years ago

Closed 5 years ago

#1135 closed defect (fixed)

length of outbuf in write-perverted-string

Reported by: pjb@… Owned by:
Priority: normal Milestone:
Component: Runtime (threads, GC) Version: trunk
Keywords: write-perverted-string Cc:


When escape is nil, there could still be #
in the string that are processed (duplicated) in the output. Therefore it might be good to count the #
in that case too:

         (outbuf (make-string (if escape
                                (+ end 2 (count-if (lambda (c) (or (eql c escape)
                                                                   (eql c #\\))) string :end end))
                                (+ end 2 (count #\\ string :end end)))))

without this patch, I get errors while printing foreign-library objects:

cl-user> (defvar *libobjc* (cffi:load-foreign-library ""))
cl-user> (inspect *libobjc*)
[0]     #<foreign-library #<error printing symbol #x30200248220E> "libobjc\\.so.4">
[1]     Class: #<standard-class cffi:foreign-library>
[2]     Wrapper: #<ccl::class-wrapper cffi:foreign-library #x3020020D1A9D>
        Instance slots
[3]     cffi::name: #:LIBOBJC\\.SO.4-8904
[4]     type: :system
[5]     cffi::spec: ((t ""))
[6]     cffi::options: (:convention :cdecl)
[7]     cffi::handle: #<shlib #x30200243817D>
[8]     pathname: #P"libobjc\\.so.4"

Change History (1)

comment:1 Changed 5 years ago by rme

  • Resolution set to fixed
  • Status changed from new to closed

(In [16516]) Apply fix to write-perverted-string from ticket:1301.

Closes ticket:1301 and ticket:1135.

Note: See TracTickets for help on using tickets.