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
Closed

regression in scanf #6791

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

Comments

@vicuna
Copy link

vicuna 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
Copy link
Author

vicuna 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
Copy link
Author

vicuna commented Mar 7, 2015

Comment author: @gasche

Merged in trunk and 4.02.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants