Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
6f92870a
Commit
6f92870a
authored
Nov 21, 2005
by
Rein Klazes
Committed by
Alexandre Julliard
Nov 21, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix _mbsspn() with conformance tests.
parent
1833cfba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
20 deletions
+40
-20
mbcs.c
dlls/msvcrt/mbcs.c
+22
-20
string.c
dlls/msvcrt/tests/string.c
+18
-0
No files found.
dlls/msvcrt/mbcs.c
View file @
6f92870a
...
...
@@ -1154,29 +1154,31 @@ unsigned char* _mbsupr(unsigned char* s)
*/
MSVCRT_size_t
_mbsspn
(
const
unsigned
char
*
string
,
const
unsigned
char
*
set
)
{
const
unsigned
char
*
p
,
*
q
;
const
unsigned
char
*
p
,
*
q
;
for
(
p
=
string
;
*
p
;
p
++
)
for
(
p
=
string
;
*
p
;
p
++
)
{
if
(
MSVCRT_isleadbyte
(
*
p
))
{
for
(
q
=
set
;
*
q
;
q
++
)
{
if
(
!
q
[
1
])
break
;
if
((
*
p
==
*
q
)
&&
(
p
[
1
]
==
q
[
1
]))
break
;
q
++
;
}
if
(
*++
p
==
'\0'
)
break
;
}
else
for
(
q
=
set
;
*
q
;
q
++
)
if
(
*
p
==
*
q
)
break
;
if
(
MSVCRT_isleadbyte
(
*
p
))
{
for
(
q
=
set
;
*
q
;
q
++
)
{
if
(
!
q
[
1
])
break
;
if
((
*
p
==
*
q
)
&&
(
p
[
1
]
==
q
[
1
]))
break
;
q
++
;
}
if
(
!
q
[
0
]
||
!
q
[
1
])
break
;
}
else
{
for
(
q
=
set
;
*
q
;
q
++
)
if
(
*
p
==
*
q
)
break
;
if
(
!*
q
)
break
;
}
}
return
p
-
string
;
return
p
-
string
;
}
/*********************************************************************
...
...
dlls/msvcrt/tests/string.c
View file @
6f92870a
...
...
@@ -21,6 +21,7 @@
#include "wine/test.h"
#include "winbase.h"
#include <string.h>
#include <mbstring.h>
#include <stdlib.h>
#include <mbctype.h>
...
...
@@ -83,6 +84,21 @@ void test_ismbblead()
_setmbcp
(
1252
);
}
static
void
test_mbsspn
(
void
)
{
unsigned
char
str1
[]
=
"cabernet"
;
unsigned
char
str2
[]
=
"shiraz"
;
unsigned
char
set
[]
=
"abc"
;
unsigned
char
empty
[]
=
""
;
int
ret
;
ret
=
_mbsspn
(
str1
,
set
);
ok
(
ret
==
3
,
"_mbsspn returns %d should be 3
\n
"
,
ret
);
ret
=
_mbsspn
(
str2
,
set
);
ok
(
ret
==
0
,
"_mbsspn returns %d should be 0
\n
"
,
ret
);
ret
=
_mbsspn
(
str1
,
empty
);
ok
(
ret
==
0
,
"_mbsspn returns %d should be 0
\n
"
,
ret
);
}
START_TEST
(
string
)
{
void
*
mem
;
...
...
@@ -107,4 +123,6 @@ START_TEST(string)
/* Test ismbblead*/
test_ismbblead
();
/* test _mbsspn */
test_mbsspn
();
}
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