You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5605 Reporter: furuse Assigned to:@protz Status: closed (set by @xavierleroy on 2013-08-31T10:49:13Z) Resolution: fixed Priority: high Severity: major Category: standard library Duplicate of:#5380
Bug description
In OCaml 3.12.1,
Scanf.scanf "%S %S@\n" (fun x y -> (x,y));;
"hello" "world"
: string * string = ("hello", "world")
In OCaml 4.01.0+dev2_2012-04-17,
Scanf.scanf "%S %S@\n" (fun x y -> (x,y));;
"hello" "world"
Exception:
Scanf.Scan_failure
"scanf: bad input at char number 27: ``looking for '@', found '\n'''".
I do not know it is a bug or not, but this difference causes trouble at ocaml setup.ml -build in OASIS.
An interesting thing is that the following works fine:
Scanf.scanf "%S %S %s@\n" (fun x y z -> (x,y,z));;
By reading the comment in scanf.mli, I understand the current behaviour is correct wrt it. So, I think it is a bug of OASIS caused by a buggy implementation of the old scanf.ml.
(** Scanning indications appear just after the string conversions [%s]
and [%[ range ]] to delimit the end of the token. A scanning
indication is introduced by a [@] character, followed by some
plain character [c]. It means that the string token should end
just before the next matching [c] (which is skipped). If no [c]
character is encountered, the string token spreads as much as
possible. For instance, ["%s@\t"] reads a string up to the next
tab character or to the end of input. If a [@] character appears
anywhere else in the format string, it is treated as a plain character.
Original bug ID: 5605
Reporter: furuse
Assigned to: @protz
Status: closed (set by @xavierleroy on 2013-08-31T10:49:13Z)
Resolution: fixed
Priority: high
Severity: major
Category: standard library
Duplicate of: #5380
Bug description
In OCaml 3.12.1,
Scanf.scanf "%S %S@\n" (fun x y -> (x,y));;
"hello" "world"
In OCaml 4.01.0+dev2_2012-04-17,
Scanf.scanf "%S %S@\n" (fun x y -> (x,y));;
"hello" "world"
Exception:
Scanf.Scan_failure
"scanf: bad input at char number 27: ``looking for '@', found '\n'''".
I do not know it is a bug or not, but this difference causes trouble at ocaml setup.ml -build in OASIS.
An interesting thing is that the following works fine:
Scanf.scanf "%S %S %s@\n" (fun x y z -> (x,y,z));;
"hello" "world" bye
The text was updated successfully, but these errors were encountered: