#79 closed defect (fixed)

File-position at start of file is wrong

Reported by: rtoy Owned by: somebody
Priority: major Milestone:
Component: Core Version: 2013-03-a
Keywords: Cc:

Description

Let foo be an file of latin1 characters. Then

(with-open-file (s "foo" :external-format :latin1)
  (print (file-position s))
  (read-char s)
  (print (file-position s)))

prints

512
513

This is totally unexpected. I would expect 0 and 1 to be printed.

If foo has utf8 encoding then

(with-open-file (s "foo" :external-format :utf8)
  (print (file-position s))
  (read-char s)
  (print (file-position s)))

prints something like

512
1

I would expect 0 to be printed instead of 512.

Change History (1)

comment:1 Changed 20 months ago by toy.raymond@…

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

commit a1c04fe77fbea96b5c038547f64a6fff0089ed77 Author: Raymond Toy <toy.raymond@…> Date: Sat Mar 23 10:27:43 2013 -0700

Fix ticket:79

  • Initialize in-length to in-buffer-length, not 0.
  • Added a few more debugging prints.
Note: See TracTickets for help on using tickets.