Issue 20392 - formattedRead: %*d and %d should read the same
Summary: formattedRead: %*d and %d should read the same
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-14 18:14 UTC by berni44
Modified: 2024-12-01 16:36 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description berni44 2019-11-14 18:14:48 UTC
This throws an exception:

---
import std.format;

void main()
{
    string str = "foo bar buzz";
    string a, c;
    int b;
    formattedRead(str, "%s %d %s", &a, &b, &c);
}
---

This not:

---
import std.format;

void main()
{
    string str = "foo bar buzz";
    string a, c;
    formattedRead(str, "%s %*d %s", &a, &c);
}
---

The reason is, that %*d accepts an empty string as a number while %d doesn't.
Comment 1 dlangBugzillaToGithub 2024-12-01 16:36:03 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/phobos/issues/9784

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB