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
b8ee0dd7
Commit
b8ee0dd7
authored
Nov 29, 2012
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 29, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Added mbrlen implementation.
parent
d55eabbb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
mbcs.c
dlls/msvcrt/mbcs.c
+33
-1
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+1
-1
No files found.
dlls/msvcrt/mbcs.c
View file @
b8ee0dd7
...
...
@@ -1902,12 +1902,44 @@ int CDECL MSVCRT_mblen(const char* str, MSVCRT_size_t size)
if
(
get_locinfo
()
->
mb_cur_max
==
1
)
return
1
;
/* ASCII CP */
return
!
MSVCRT_isleadbyte
(
*
str
)
?
1
:
(
size
>
1
?
2
:
-
1
);
return
!
MSVCRT_isleadbyte
(
(
unsigned
char
)
*
str
)
?
1
:
(
size
>
1
?
2
:
-
1
);
}
return
0
;
}
/*********************************************************************
* mbrlen(MSVCRT.@)
*/
MSVCRT_size_t
CDECL
MSVCRT_mbrlen
(
const
char
*
str
,
MSVCRT_size_t
len
,
MSVCRT_mbstate_t
*
state
)
{
MSVCRT_mbstate_t
s
=
(
state
?
*
state
:
0
);
MSVCRT_size_t
ret
;
if
(
!
len
||
!
str
||
!*
str
)
return
0
;
if
(
get_locinfo
()
->
mb_cur_max
==
1
)
{
return
1
;
}
else
if
(
!
s
&&
MSVCRT_isleadbyte
((
unsigned
char
)
*
str
))
{
if
(
len
==
1
)
{
s
=
(
unsigned
char
)
*
str
;
ret
=
-
2
;
}
else
{
ret
=
2
;
}
}
else
if
(
!
s
)
{
ret
=
1
;
}
else
{
s
=
0
;
ret
=
2
;
}
if
(
state
)
*
state
=
s
;
return
ret
;
}
/*********************************************************************
* _mbstrlen_l(MSVCRT.@)
*/
MSVCRT_size_t
CDECL
_mbstrlen_l
(
const
char
*
str
,
MSVCRT__locale_t
locale
)
...
...
dlls/msvcrt/msvcrt.spec
View file @
b8ee0dd7
...
...
@@ -1328,7 +1328,7 @@
@ cdecl -arch=i386,x86_64 longjmp(ptr long) MSVCRT_longjmp
@ cdecl malloc(long) MSVCRT_malloc
@ cdecl mblen(ptr long) MSVCRT_mblen
# stub mbrlen(ptr long ptr)
@ cdecl mbrlen(ptr long ptr) MSVCRT_mbrlen
# stub mbrtowc(ptr str long ptr)
# stub mbsdup_dbg(wstr long ptr long)
# stub mbsrtowcs(ptr ptr long ptr)
...
...
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