Signed-off-by: Will Mainio will.mainio@fastmail.com --- dlls/msvcrt/tests/scanf.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/dlls/msvcrt/tests/scanf.c b/dlls/msvcrt/tests/scanf.c index 57d9cc0ba12..4b878e6d64e 100644 --- a/dlls/msvcrt/tests/scanf.c +++ b/dlls/msvcrt/tests/scanf.c @@ -186,6 +186,14 @@ static void test_sscanf( void ) ok( ret == 1, "Error with format "%s"\n","%*[a-cd-dg-e]%c"); ok( buffer[0] == 'h', "Error with "abcefgdh" "%c"\n", buffer[0]);
+ ret = p_sscanf("-123","%[-0-9]s",buffer); + ok( ret == 1, "Error with format "%s"\n","%[-0-9]s"); + ok( strncmp("-123",buffer,strlen(buffer)) == 0, "Error with "-123" "%s"\n",buffer); + + ret = p_sscanf("-321","%[0-9-]s",buffer); + ok( ret == 1, "Error with format "%s"\n","%[0-9-]s"); + ok( strncmp("-321",buffer,strlen(buffer)) == 0, "Error with "-321" "%s"\n",buffer); + buffer1[0] = 'b'; ret = p_sscanf("a","%s%s", buffer, buffer1); ok( ret == 1, "expected 1, got %u\n", ret);
Signed-off-by: Will Mainio will.mainio@fastmail.com --- dlls/msvcrt/scanf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/msvcrt/scanf.h b/dlls/msvcrt/scanf.h index 3b4686c1107..b0254ef9224 100644 --- a/dlls/msvcrt/scanf.h +++ b/dlls/msvcrt/scanf.h @@ -639,7 +639,7 @@ _FUNCTION_ { while(*format && (*format != ']')) { /* According to msdn: * "Note that %[a-z] and %[z-a] are interpreted as equivalent to %[abcde...z]." */ - if((*format == '-') && (*(format + 1) != ']')) { + if((*format == '-') && (*(format - 1) != '[') && (*(format + 1) != ']')) { if ((*(format - 1)) < *(format + 1)) RtlSetBits(&bitMask, *(format - 1) +1 , *(format + 1) - *(format - 1)); else
Hi Will,
You will either need to reorder your patches or add todo_wine to the ok()'s that are supposed to fail and remove them in your second patch.
Kind regards, Gijs
On Fri, Oct 30, 2020, 12:39 Will Mainio will.mainio@fastmail.com wrote:
Signed-off-by: Will Mainio will.mainio@fastmail.com
dlls/msvcrt/tests/scanf.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/dlls/msvcrt/tests/scanf.c b/dlls/msvcrt/tests/scanf.c index 57d9cc0ba12..4b878e6d64e 100644 --- a/dlls/msvcrt/tests/scanf.c +++ b/dlls/msvcrt/tests/scanf.c @@ -186,6 +186,14 @@ static void test_sscanf( void ) ok( ret == 1, "Error with format "%s"\n","%*[a-cd-dg-e]%c"); ok( buffer[0] == 'h', "Error with "abcefgdh" "%c"\n", buffer[0]);
- ret = p_sscanf("-123","%[-0-9]s",buffer);
- ok( ret == 1, "Error with format "%s"\n","%[-0-9]s");
- ok( strncmp("-123",buffer,strlen(buffer)) == 0, "Error with "-123"
"%s"\n",buffer);
- ret = p_sscanf("-321","%[0-9-]s",buffer);
- ok( ret == 1, "Error with format "%s"\n","%[0-9-]s");
- ok( strncmp("-321",buffer,strlen(buffer)) == 0, "Error with "-321"
"%s"\n",buffer);
- buffer1[0] = 'b'; ret = p_sscanf("a","%s%s", buffer, buffer1); ok( ret == 1, "expected 1, got %u\n", ret);
-- 2.28.0
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=81265
Your paranoid android.
=== build (build log) ===
error: corrupt patch at line 54 Task: Patch failed to apply
=== debiant (build log) ===
Task: Patch failed to apply
=== debiant (build log) ===
Task: Patch failed to apply
Hi Gijs,
I will reorder the patches and submit a v2. Thanks for the heads up.
Cheers
On Fri, Oct 30, 2020, at 1:00 PM, Gijs Vermeulen wrote:
Hi Will,
You will either need to reorder your patches or add todo_wine to the ok()'s that are supposed to fail and remove them in your second patch.
Kind regards, Gijs
On Fri, Oct 30, 2020, 12:39 Will Mainio will.mainio@fastmail.com wrote:
Signed-off-by: Will Mainio will.mainio@fastmail.com
dlls/msvcrt/tests/scanf.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/dlls/msvcrt/tests/scanf.c b/dlls/msvcrt/tests/scanf.c index 57d9cc0ba12..4b878e6d64e 100644 --- a/dlls/msvcrt/tests/scanf.c +++ b/dlls/msvcrt/tests/scanf.c @@ -186,6 +186,14 @@ static void test_sscanf( void ) ok( ret == 1, "Error with format "%s"\n","%*[a-cd-dg-e]%c"); ok( buffer[0] == 'h', "Error with "abcefgdh" "%c"\n", buffer[0]);
- ret = p_sscanf("-123","%[-0-9]s",buffer);
- ok( ret == 1, "Error with format "%s"\n","%[-0-9]s");
- ok( strncmp("-123",buffer,strlen(buffer)) == 0, "Error with "-123" "%s"\n",buffer);
- ret = p_sscanf("-321","%[0-9-]s",buffer);
- ok( ret == 1, "Error with format "%s"\n","%[0-9-]s");
- ok( strncmp("-321",buffer,strlen(buffer)) == 0, "Error with "-321" "%s"\n",buffer);
- buffer1[0] = 'b'; ret = p_sscanf("a","%s%s", buffer, buffer1); ok( ret == 1, "expected 1, got %u\n", ret);
-- 2.28.0
Hi Will,
There are more problems with current implementation. The '-' character can be also added to the set if it's not defining a range even if it's not the first or last character. You can see it running following test: sscanf("123", "%[1-2-4]s", buf); This format will look for 1-2 range, '-' character and '4' (not for 1-2 range and 2-4 range).
Thanks, Piotr
On 10/30/20 1:23 PM, Will Mainio wrote:
Hi Gijs,
I will reorder the patches and submit a v2. Thanks for the heads up.
Cheers
On Fri, Oct 30, 2020, at 1:00 PM, Gijs Vermeulen wrote:
Hi Will,
You will either need to reorder your patches or add todo_wine to the ok()'s that are supposed to fail and remove them in your second patch.
Kind regards, Gijs
On Fri, Oct 30, 2020, 12:39 Will Mainio will.mainio@fastmail.com wrote:
Signed-off-by: Will Mainio will.mainio@fastmail.com
dlls/msvcrt/tests/scanf.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/dlls/msvcrt/tests/scanf.c b/dlls/msvcrt/tests/scanf.c index 57d9cc0ba12..4b878e6d64e 100644 --- a/dlls/msvcrt/tests/scanf.c +++ b/dlls/msvcrt/tests/scanf.c @@ -186,6 +186,14 @@ static void test_sscanf( void ) ok( ret == 1, "Error with format "%s"\n","%*[a-cd-dg-e]%c"); ok( buffer[0] == 'h', "Error with "abcefgdh" "%c"\n", buffer[0]);
- ret = p_sscanf("-123","%[-0-9]s",buffer);
- ok( ret == 1, "Error with format "%s"\n","%[-0-9]s");
- ok( strncmp("-123",buffer,strlen(buffer)) == 0, "Error with "-123" "%s"\n",buffer);
- ret = p_sscanf("-321","%[0-9-]s",buffer);
- ok( ret == 1, "Error with format "%s"\n","%[0-9-]s");
- ok( strncmp("-321",buffer,strlen(buffer)) == 0, "Error with "-321" "%s"\n",buffer);
buffer1[0] = 'b'; ret = p_sscanf("a","%s%s", buffer, buffer1); ok( ret == 1, "expected 1, got %u\n", ret);
-- 2.28.0
Hi Piotr,
unfortunately I am not very familiar with C so I can't implement that but I can add tests with dashes in various locations. Should that go into a v3 or into a separate patch?
Cheers
On Fri, Oct 30, 2020, at 1:45 PM, Piotr Caban wrote:
Hi Will,
There are more problems with current implementation. The '-' character can be also added to the set if it's not defining a range even if it's not the first or last character. You can see it running following test: sscanf("123", "%[1-2-4]s", buf); This format will look for 1-2 range, '-' character and '4' (not for 1-2 range and 2-4 range).
Thanks, Piotr
On 10/30/20 1:23 PM, Will Mainio wrote:
Hi Gijs,
I will reorder the patches and submit a v2. Thanks for the heads up.
Cheers
On Fri, Oct 30, 2020, at 1:00 PM, Gijs Vermeulen wrote:
Hi Will,
You will either need to reorder your patches or add todo_wine to the ok()'s that are supposed to fail and remove them in your second patch.
Kind regards, Gijs
On Fri, Oct 30, 2020, 12:39 Will Mainio will.mainio@fastmail.com wrote:
Signed-off-by: Will Mainio will.mainio@fastmail.com
dlls/msvcrt/tests/scanf.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/dlls/msvcrt/tests/scanf.c b/dlls/msvcrt/tests/scanf.c index 57d9cc0ba12..4b878e6d64e 100644 --- a/dlls/msvcrt/tests/scanf.c +++ b/dlls/msvcrt/tests/scanf.c @@ -186,6 +186,14 @@ static void test_sscanf( void ) ok( ret == 1, "Error with format "%s"\n","%*[a-cd-dg-e]%c"); ok( buffer[0] == 'h', "Error with "abcefgdh" "%c"\n", buffer[0]);
- ret = p_sscanf("-123","%[-0-9]s",buffer);
- ok( ret == 1, "Error with format "%s"\n","%[-0-9]s");
- ok( strncmp("-123",buffer,strlen(buffer)) == 0, "Error with "-123" "%s"\n",buffer);
- ret = p_sscanf("-321","%[0-9-]s",buffer);
- ok( ret == 1, "Error with format "%s"\n","%[0-9-]s");
- ok( strncmp("-321",buffer,strlen(buffer)) == 0, "Error with "-321" "%s"\n",buffer);
buffer1[0] = 'b'; ret = p_sscanf("a","%s%s", buffer, buffer1); ok( ret == 1, "expected 1, got %u\n", ret);
-- 2.28.0
Never mind that, it was simple enough for me to implement. I submitted a v3 that can handle dashes in any location.
Cheers
On Fri, Oct 30, 2020, at 6:54 PM, Will Mainio wrote:
Hi Piotr,
unfortunately I am not very familiar with C so I can't implement that but I can add tests with dashes in various locations. Should that go into a v3 or into a separate patch?
Cheers
On Fri, Oct 30, 2020, at 1:45 PM, Piotr Caban wrote:
Hi Will,
There are more problems with current implementation. The '-' character can be also added to the set if it's not defining a range even if it's not the first or last character. You can see it running following test: sscanf("123", "%[1-2-4]s", buf); This format will look for 1-2 range, '-' character and '4' (not for 1-2 range and 2-4 range).
Thanks, Piotr
On 10/30/20 1:23 PM, Will Mainio wrote:
Hi Gijs,
I will reorder the patches and submit a v2. Thanks for the heads up.
Cheers
On Fri, Oct 30, 2020, at 1:00 PM, Gijs Vermeulen wrote:
Hi Will,
You will either need to reorder your patches or add todo_wine to the ok()'s that are supposed to fail and remove them in your second patch.
Kind regards, Gijs
On Fri, Oct 30, 2020, 12:39 Will Mainio will.mainio@fastmail.com wrote:
Signed-off-by: Will Mainio will.mainio@fastmail.com
dlls/msvcrt/tests/scanf.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/dlls/msvcrt/tests/scanf.c b/dlls/msvcrt/tests/scanf.c index 57d9cc0ba12..4b878e6d64e 100644 --- a/dlls/msvcrt/tests/scanf.c +++ b/dlls/msvcrt/tests/scanf.c @@ -186,6 +186,14 @@ static void test_sscanf( void ) ok( ret == 1, "Error with format "%s"\n","%*[a-cd-dg-e]%c"); ok( buffer[0] == 'h', "Error with "abcefgdh" "%c"\n", buffer[0]);
- ret = p_sscanf("-123","%[-0-9]s",buffer);
- ok( ret == 1, "Error with format "%s"\n","%[-0-9]s");
- ok( strncmp("-123",buffer,strlen(buffer)) == 0, "Error with "-123" "%s"\n",buffer);
- ret = p_sscanf("-321","%[0-9-]s",buffer);
- ok( ret == 1, "Error with format "%s"\n","%[0-9-]s");
- ok( strncmp("-321",buffer,strlen(buffer)) == 0, "Error with "-321" "%s"\n",buffer);
buffer1[0] = 'b'; ret = p_sscanf("a","%s%s", buffer, buffer1); ok( ret == 1, "expected 1, got %u\n", ret);
-- 2.28.0
Hi Will,
I have sent simplified version of your patch as v4.
Thanks, Piotr
On 10/31/20 7:13 PM, Will Mainio wrote:
Never mind that, it was simple enough for me to implement. I submitted a v3 that can handle dashes in any location.
Cheers
On Fri, Oct 30, 2020, at 6:54 PM, Will Mainio wrote:
Hi Piotr,
unfortunately I am not very familiar with C so I can't implement that but I can add tests with dashes in various locations. Should that go into a v3 or into a separate patch?
Cheers
On Fri, Oct 30, 2020, at 1:45 PM, Piotr Caban wrote:
Hi Will,
There are more problems with current implementation. The '-' character can be also added to the set if it's not defining a range even if it's not the first or last character. You can see it running following test: sscanf("123", "%[1-2-4]s", buf); This format will look for 1-2 range, '-' character and '4' (not for 1-2 range and 2-4 range).
Thanks, Piotr
On 10/30/20 1:23 PM, Will Mainio wrote:
Hi Gijs,
I will reorder the patches and submit a v2. Thanks for the heads up.
Cheers
On Fri, Oct 30, 2020, at 1:00 PM, Gijs Vermeulen wrote:
Hi Will,
You will either need to reorder your patches or add todo_wine to the ok()'s that are supposed to fail and remove them in your second patch.
Kind regards, Gijs
On Fri, Oct 30, 2020, 12:39 Will Mainio will.mainio@fastmail.com wrote:
Signed-off-by: Will Mainio will.mainio@fastmail.com
dlls/msvcrt/tests/scanf.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/dlls/msvcrt/tests/scanf.c b/dlls/msvcrt/tests/scanf.c index 57d9cc0ba12..4b878e6d64e 100644 --- a/dlls/msvcrt/tests/scanf.c +++ b/dlls/msvcrt/tests/scanf.c @@ -186,6 +186,14 @@ static void test_sscanf( void ) ok( ret == 1, "Error with format "%s"\n","%*[a-cd-dg-e]%c"); ok( buffer[0] == 'h', "Error with "abcefgdh" "%c"\n", buffer[0]);
- ret = p_sscanf("-123","%[-0-9]s",buffer);
- ok( ret == 1, "Error with format "%s"\n","%[-0-9]s");
- ok( strncmp("-123",buffer,strlen(buffer)) == 0, "Error with "-123" "%s"\n",buffer);
- ret = p_sscanf("-321","%[0-9-]s",buffer);
- ok( ret == 1, "Error with format "%s"\n","%[0-9-]s");
- ok( strncmp("-321",buffer,strlen(buffer)) == 0, "Error with "-321" "%s"\n",buffer);
buffer1[0] = 'b'; ret = p_sscanf("a","%s%s", buffer, buffer1); ok( ret == 1, "expected 1, got %u\n", ret);
-- 2.28.0
Hi Piotr,
that's great, thank you!
Cheers
On Mon, Nov 2, 2020, at 4:02 PM, Piotr Caban wrote:
Hi Will,
I have sent simplified version of your patch as v4.
Thanks, Piotr
On 10/31/20 7:13 PM, Will Mainio wrote:
Never mind that, it was simple enough for me to implement. I submitted a v3 that can handle dashes in any location.
Cheers
On Fri, Oct 30, 2020, at 6:54 PM, Will Mainio wrote:
Hi Piotr,
unfortunately I am not very familiar with C so I can't implement that but I can add tests with dashes in various locations. Should that go into a v3 or into a separate patch?
Cheers
On Fri, Oct 30, 2020, at 1:45 PM, Piotr Caban wrote:
Hi Will,
There are more problems with current implementation. The '-' character can be also added to the set if it's not defining a range even if it's not the first or last character. You can see it running following test: sscanf("123", "%[1-2-4]s", buf); This format will look for 1-2 range, '-' character and '4' (not for 1-2 range and 2-4 range).
Thanks, Piotr
On 10/30/20 1:23 PM, Will Mainio wrote:
Hi Gijs,
I will reorder the patches and submit a v2. Thanks for the heads up.
Cheers
On Fri, Oct 30, 2020, at 1:00 PM, Gijs Vermeulen wrote:
Hi Will,
You will either need to reorder your patches or add todo_wine to the ok()'s that are supposed to fail and remove them in your second patch.
Kind regards, Gijs
On Fri, Oct 30, 2020, 12:39 Will Mainio will.mainio@fastmail.com wrote: > Signed-off-by: Will Mainio will.mainio@fastmail.com > --- > dlls/msvcrt/tests/scanf.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/dlls/msvcrt/tests/scanf.c b/dlls/msvcrt/tests/scanf.c > index 57d9cc0ba12..4b878e6d64e 100644 > --- a/dlls/msvcrt/tests/scanf.c > +++ b/dlls/msvcrt/tests/scanf.c > @@ -186,6 +186,14 @@ static void test_sscanf( void ) > ok( ret == 1, "Error with format "%s"\n","%*[a-cd-dg-e]%c"); > ok( buffer[0] == 'h', "Error with "abcefgdh" "%c"\n", buffer[0]); > > + ret = p_sscanf("-123","%[-0-9]s",buffer); > + ok( ret == 1, "Error with format "%s"\n","%[-0-9]s"); > + ok( strncmp("-123",buffer,strlen(buffer)) == 0, "Error with "-123" "%s"\n",buffer); > + > + ret = p_sscanf("-321","%[0-9-]s",buffer); > + ok( ret == 1, "Error with format "%s"\n","%[0-9-]s"); > + ok( strncmp("-321",buffer,strlen(buffer)) == 0, "Error with "-321" "%s"\n",buffer); > + > buffer1[0] = 'b'; > ret = p_sscanf("a","%s%s", buffer, buffer1); > ok( ret == 1, "expected 1, got %u\n", ret); > -- > 2.28.0 > >
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=81262
Your paranoid android.
=== debiant (32 bit report) ===
msvcrt: scanf.c:190: Test failed: Error with format "%[-0-9]s"
=== debiant (32 bit French report) ===
msvcrt: scanf.c:190: Test failed: Error with format "%[-0-9]s"
=== debiant (32 bit Japanese:Japan report) ===
msvcrt: scanf.c:190: Test failed: Error with format "%[-0-9]s"
=== debiant (32 bit Chinese:China report) ===
msvcrt: scanf.c:190: Test failed: Error with format "%[-0-9]s"
=== debiant (32 bit WoW report) ===
msvcrt: scanf.c:190: Test failed: Error with format "%[-0-9]s"
=== debiant (64 bit WoW report) ===
msvcrt: scanf.c:190: Test failed: Error with format "%[-0-9]s"