Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
bf724444
Commit
bf724444
authored
May 25, 2021
by
Piotr Caban
Committed by
Alexandre Julliard
May 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Update search position when no token was found in strtok.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
32bbef5d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
string.c
dlls/msvcrt/string.c
+5
-1
string.c
dlls/msvcrt/tests/string.c
+8
-0
No files found.
dlls/msvcrt/string.c
View file @
bf724444
...
@@ -287,7 +287,11 @@ char * CDECL strtok( char *str, const char *delim )
...
@@ -287,7 +287,11 @@ char * CDECL strtok( char *str, const char *delim )
if
(
!
(
str
=
data
->
strtok_next
))
return
NULL
;
if
(
!
(
str
=
data
->
strtok_next
))
return
NULL
;
while
(
*
str
&&
strchr
(
delim
,
*
str
))
str
++
;
while
(
*
str
&&
strchr
(
delim
,
*
str
))
str
++
;
if
(
!*
str
)
return
NULL
;
if
(
!*
str
)
{
data
->
strtok_next
=
str
;
return
NULL
;
}
ret
=
str
++
;
ret
=
str
++
;
while
(
*
str
&&
!
strchr
(
delim
,
*
str
))
str
++
;
while
(
*
str
&&
!
strchr
(
delim
,
*
str
))
str
++
;
if
(
*
str
)
*
str
++
=
0
;
if
(
*
str
)
*
str
++
=
0
;
...
...
dlls/msvcrt/tests/string.c
View file @
bf724444
...
@@ -1685,6 +1685,14 @@ static void test_strtok(void)
...
@@ -1685,6 +1685,14 @@ static void test_strtok(void)
"third call string (%p)
\'
%s
\'
return %p
\n
"
,
"third call string (%p)
\'
%s
\'
return %p
\n
"
,
teststr
,
testcases_strtok
[
i
].
string
,
strret
);
teststr
,
testcases_strtok
[
i
].
string
,
strret
);
}
}
strcpy
(
teststr
,
"test a=b"
);
strret
=
strtok
(
teststr
,
" "
);
ok
(
strret
==
teststr
,
"strret = %p, expected %p
\n
"
,
strret
,
teststr
);
strret
=
strtok
(
NULL
,
"ab="
);
ok
(
!
strret
,
"strret = %p, expected NULL
\n
"
,
strret
);
strret
=
strtok
(
NULL
,
"="
);
ok
(
!
strret
,
"strret = %p, expected NULL
\n
"
,
strret
);
}
}
static
void
test_strtol
(
void
)
static
void
test_strtol
(
void
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment