Opened 6 years ago

Closed 4 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:

Description

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 "libobjc.so.4"))
*libobjc*
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 "libobjc.so.4"))
[6]     cffi::options: (:convention :cdecl)
[7]     cffi::handle: #<shlib libobjc.so.4 #x30200243817D>
[8]     pathname: #P"libobjc\\.so.4"
Inspect> 

Change History (1)

comment:1 Changed 4 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.