Opened 15 years ago

Closed 15 years ago

#79 closed defect (fixed)

z3.egg eof handling bug

Reported by: Tony Sidaway Owned by: Tony Sidaway
Priority: major Milestone:
Component: extensions Version: 4.1.x
Keywords: z3 egg eof Cc:
Estimated difficulty:

Description

This refers to revision 16161, z3.egg as of 9 October, 2009.

If an attempt is made to read from a compressed input file port (z3:open-compressed-input-file) after the eof is reached, it throws an error like this:

Error: (z3:read-decoded) can not read encoded data - Invalid or incomplete multibyte or wide character

This is because it is attempting to fetch data that isn't there.

Suggested fix: bind an eof flag with a value of #f in the let* clause inside z3:open-compressed-input-file. In read-next, set the flag to #t on encountering an end of file condition, and check the flag on each call to read-next prior to attempting to read further characters from the input file, simply returning #!eof if it is set.

Attachments (1)

diff (779 bytes) - added by Tony Sidaway 15 years ago.
svn diff for suggested fix (patches z3.scm)

Download all attachments as: .zip

Change History (4)

Changed 15 years ago by Tony Sidaway

Attachment: diff added

svn diff for suggested fix (patches z3.scm)

comment:1 Changed 15 years ago by felix winkelmann

Owner: set to felix winkelmann
Status: newassigned

comment:2 Changed 15 years ago by Tony Sidaway

Owner: changed from felix winkelmann to Tony Sidaway
Status: assignedaccepted

comment:3 Changed 15 years ago by Tony Sidaway

Resolution: fixed
Status: acceptedclosed

Applied patch helpfully provided by ticket creator. :)

Note: See TracTickets for help on using tickets.