Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regression in scanf #6791

Closed
vicuna opened this issue Feb 23, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link

commented Feb 23, 2015

Original bug ID: 6791
Reporter: milanst
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2016-12-07T10:47:17Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.1
Category: standard library
Monitored by: @hcarty

Bug description

There is a scanf regression where @c doesn't stop scanning for every character 'c'. In particular, it seems it is broken when character is a valid format specifier.

Steps to reproduce

utop # Scanf.sscanf "some-thing{1..3}" "%s@{%d..%d}" (fun s n1 n2 -> s,n1,n2);;
Exception: End_of_file.

But this works:
utop # Scanf.sscanf "some-thingI{1..3}" "%s@I{%d..%d}" (fun s n1 n2 ->
s,n1,n2);;

  • : bytes * int * int = ("some-thing", 1, 3)

I haven't tried but apparently both work fine in 4.01.

File attachments

@vicuna

This comment has been minimized.

Copy link
Author

commented Feb 23, 2015

Comment author: @gasche

Benoît Vaugon wrote a patch to fix this, I'll upload it here for reference. It looks good, I'd like a testsuite occurence of the issue, which I will probably add when the patch is merged.

@vicuna

This comment has been minimized.

Copy link
Author

commented Mar 7, 2015

Comment author: @gasche

Merged in trunk and 4.02.

@vicuna vicuna closed this Dec 7, 2016

@vicuna vicuna added the stdlib label Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.