Positioning of a stream after peek-char to position 0 will result in position -1
Given a non-empty text file,
when the stream is positioned in the text file and a character is read using peek-char
then the following file-position
operation to position 0 succeeds, but the stream is positioned at position -1.
> (with-open-file (str #P"test.dat"
:direction :input
:element-type :default
:external-format :default) (file-position str 1) (peek-char nil str) (format t "~A" (file-position str 0)) (file-position str))
T
-1
The expected result would be that the stream is positioned at position 0.
Provide details regarding ECL version (or preferably commit), operating system and if relevant the build options and versions of the build tools.
> (lisp-implementation-version)
"16.1.3"
> (ext:lisp-implementation-vcs-id)`
"21f670894a14dd000229cc8fed4c0bc10ce7d37d"
> (software-type)
(SOFTWARE-TYPE)
> (software-version)
"4.9.0-9-amd64"
> (machine-type)
"x86_64"
> *features*
(:WALKER :CDR-1 :CDR-5 :LINUX :FORMATTER :CDR-7 :ECL-WEAK-HASH :LITTLE-ENDIAN
:ECL-READ-WRITE-LOCK :LONG-LONG :UINT64-T :UINT32-T :UINT16-T :LONG-FLOAT
:UNICODE :DFFI :CLOS-STREAMS :CMU-FORMAT :UNIX :ECL-PDE :DLOPEN :CLOS :THREADS
:BOEHM-GC :ANSI-CL :COMMON-LISP :IEEE-FLOATING-POINT :PACKAGE-LOCAL-NICKNAMES
:CDR-14 :PREFIXED-API :FFI :X86_64 :COMMON :ECL)