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
ab5db464
Commit
ab5db464
authored
Apr 14, 2014
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Apr 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Add MBCS handling for _splitpath.
parent
e67f8412
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
dir.c
dlls/msvcrt/dir.c
+9
-1
dir.c
dlls/msvcrt/tests/dir.c
+27
-0
No files found.
dlls/msvcrt/dir.c
View file @
ab5db464
...
...
@@ -1059,7 +1059,15 @@ int CDECL _splitpath_s(const char* inpath,
/* look for end of directory part */
end
=
NULL
;
for
(
p
=
inpath
;
*
p
;
p
++
)
if
(
*
p
==
'/'
||
*
p
==
'\\'
)
end
=
p
+
1
;
for
(
p
=
inpath
;
*
p
;
p
++
)
{
if
(
_ismbblead
((
unsigned
char
)
*
p
))
{
p
++
;
continue
;
}
if
(
*
p
==
'/'
||
*
p
==
'\\'
)
end
=
p
+
1
;
}
if
(
end
)
/* got a directory */
{
...
...
dlls/msvcrt/tests/dir.c
View file @
ab5db464
...
...
@@ -25,6 +25,7 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <io.h>
#include <mbctype.h>
#include <windef.h>
#include <winbase.h>
#include <winnls.h>
...
...
@@ -390,6 +391,31 @@ static void test_fullpath(void)
RemoveDirectoryA
(
level1
);
}
static
void
test_splitpath
(
void
)
{
const
char
*
path
=
"c:
\\\x83\x5c\x83\x74\x83\x67
.bin"
;
char
drive
[
3
],
dir
[
MAX_PATH
],
fname
[
MAX_PATH
],
ext
[
MAX_PATH
];
int
prev_cp
=
_getmbcp
();
/* SBCS codepage */
_setmbcp
(
1252
);
_splitpath
(
path
,
drive
,
dir
,
fname
,
ext
);
ok
(
!
strcmp
(
drive
,
"c:"
),
"got %s
\n
"
,
drive
);
ok
(
!
strcmp
(
dir
,
"
\\\x83\x5c
"
),
"got %s
\n
"
,
dir
);
ok
(
!
strcmp
(
fname
,
"
\x83\x74\x83\x67
"
),
"got %s
\n
"
,
fname
);
ok
(
!
strcmp
(
ext
,
".bin"
),
"got %s
\n
"
,
ext
);
/* MBCS (Japanese) codepage */
_setmbcp
(
932
);
_splitpath
(
path
,
drive
,
dir
,
fname
,
ext
);
ok
(
!
strcmp
(
drive
,
"c:"
),
"got %s
\n
"
,
drive
);
ok
(
!
strcmp
(
dir
,
"
\\
"
),
"got %s
\n
"
,
dir
);
ok
(
!
strcmp
(
fname
,
"
\x83\x5c\x83\x74\x83\x67
"
),
"got %s
\n
"
,
fname
);
ok
(
!
strcmp
(
ext
,
".bin"
),
"got %s
\n
"
,
ext
);
_setmbcp
(
prev_cp
);
}
START_TEST
(
dir
)
{
init
();
...
...
@@ -397,4 +423,5 @@ START_TEST(dir)
test_fullpath
();
test_makepath
();
test_makepath_s
();
test_splitpath
();
}
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