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
60b3db6b
Commit
60b3db6b
authored
Apr 25, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Use _wsplitpath() from msvcrt.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c3fac6e3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
62 deletions
+9
-62
batch.c
programs/cmd/batch.c
+1
-53
builtins.c
programs/cmd/builtins.c
+5
-5
directory.c
programs/cmd/directory.c
+3
-3
wcmd.h
programs/cmd/wcmd.h
+0
-1
No files found.
programs/cmd/batch.c
View file @
60b3db6b
...
@@ -301,58 +301,6 @@ WCHAR *WCMD_fgets(WCHAR *buf, DWORD noChars, HANDLE h)
...
@@ -301,58 +301,6 @@ WCHAR *WCMD_fgets(WCHAR *buf, DWORD noChars, HANDLE h)
return
buf
;
return
buf
;
}
}
/* WCMD_splitpath - copied from winefile as no obvious way to use it otherwise */
void
WCMD_splitpath
(
const
WCHAR
*
path
,
WCHAR
*
drv
,
WCHAR
*
dir
,
WCHAR
*
name
,
WCHAR
*
ext
)
{
const
WCHAR
*
end
;
/* end of processed string */
const
WCHAR
*
p
;
/* search pointer */
const
WCHAR
*
s
;
/* copy pointer */
/* extract drive name */
if
(
path
[
0
]
&&
path
[
1
]
==
':'
)
{
if
(
drv
)
{
*
drv
++
=
*
path
++
;
*
drv
++
=
*
path
++
;
*
drv
=
'\0'
;
}
}
else
if
(
drv
)
*
drv
=
'\0'
;
end
=
path
+
lstrlenW
(
path
);
/* search for begin of file extension */
for
(
p
=
end
;
p
>
path
&&
*--
p
!=
'\\'
&&
*
p
!=
'/'
;
)
if
(
*
p
==
'.'
)
{
end
=
p
;
break
;
}
if
(
ext
)
for
(
s
=
end
;
(
*
ext
=*
s
++
);
)
ext
++
;
/* search for end of directory name */
for
(
p
=
end
;
p
>
path
;
)
if
(
*--
p
==
'\\'
||
*
p
==
'/'
)
{
p
++
;
break
;
}
if
(
name
)
{
for
(
s
=
p
;
s
<
end
;
)
*
name
++
=
*
s
++
;
*
name
=
'\0'
;
}
if
(
dir
)
{
for
(
s
=
path
;
s
<
p
;
)
*
dir
++
=
*
s
++
;
*
dir
=
'\0'
;
}
}
/****************************************************************************
/****************************************************************************
* WCMD_HandleTildaModifiers
* WCMD_HandleTildaModifiers
*
*
...
@@ -627,7 +575,7 @@ void WCMD_HandleTildaModifiers(WCHAR **start, BOOL atExecute)
...
@@ -627,7 +575,7 @@ void WCMD_HandleTildaModifiers(WCHAR **start, BOOL atExecute)
BOOL
addSpace
=
(
finaloutput
[
0
]
!=
0x00
);
BOOL
addSpace
=
(
finaloutput
[
0
]
!=
0x00
);
/* Split into components */
/* Split into components */
WCMD_
splitpath
(
fullfilename
,
drive
,
dir
,
fname
,
ext
);
_w
splitpath
(
fullfilename
,
drive
,
dir
,
fname
,
ext
);
/* 5. Handle 'd' : Drive Letter */
/* 5. Handle 'd' : Drive Letter */
if
(
wmemchr
(
firstModifier
,
'd'
,
modifierLen
)
!=
NULL
)
{
if
(
wmemchr
(
firstModifier
,
'd'
,
modifierLen
)
!=
NULL
)
{
...
...
programs/cmd/builtins.c
View file @
60b3db6b
...
@@ -1217,7 +1217,7 @@ static BOOL WCMD_delete_confirm_wildcard(const WCHAR *filename, BOOL *pPrompted)
...
@@ -1217,7 +1217,7 @@ static BOOL WCMD_delete_confirm_wildcard(const WCHAR *filename, BOOL *pPrompted)
/* Convert path into actual directory spec */
/* Convert path into actual directory spec */
GetFullPathNameW
(
filename
,
ARRAY_SIZE
(
fpath
),
fpath
,
NULL
);
GetFullPathNameW
(
filename
,
ARRAY_SIZE
(
fpath
),
fpath
,
NULL
);
WCMD_
splitpath
(
fpath
,
drive
,
dir
,
fname
,
ext
);
_w
splitpath
(
fpath
,
drive
,
dir
,
fname
,
ext
);
/* Only prompt for * and *.*, not *a, a*, *.a* etc */
/* Only prompt for * and *.*, not *a, a*, *.a* etc */
if
((
lstrcmpW
(
fname
,
starW
)
==
0
)
&&
if
((
lstrcmpW
(
fname
,
starW
)
==
0
)
&&
...
@@ -1352,7 +1352,7 @@ static BOOL WCMD_delete_one (const WCHAR *thisArg) {
...
@@ -1352,7 +1352,7 @@ static BOOL WCMD_delete_one (const WCHAR *thisArg) {
/* Convert path into actual directory spec */
/* Convert path into actual directory spec */
GetFullPathNameW
(
argCopy
,
ARRAY_SIZE
(
thisDir
),
thisDir
,
NULL
);
GetFullPathNameW
(
argCopy
,
ARRAY_SIZE
(
thisDir
),
thisDir
,
NULL
);
WCMD_
splitpath
(
thisDir
,
drive
,
dir
,
fname
,
ext
);
_w
splitpath
(
thisDir
,
drive
,
dir
,
fname
,
ext
);
lstrcpyW
(
thisDir
,
drive
);
lstrcpyW
(
thisDir
,
drive
);
lstrcatW
(
thisDir
,
dir
);
lstrcatW
(
thisDir
,
dir
);
...
@@ -2986,7 +2986,7 @@ void WCMD_move (void)
...
@@ -2986,7 +2986,7 @@ void WCMD_move (void)
wine_dbgstr_w
(
param1
),
wine_dbgstr_w
(
output
));
wine_dbgstr_w
(
param1
),
wine_dbgstr_w
(
output
));
/* Split into components */
/* Split into components */
WCMD_
splitpath
(
input
,
drive
,
dir
,
fname
,
ext
);
_w
splitpath
(
input
,
drive
,
dir
,
fname
,
ext
);
hff
=
FindFirstFileW
(
input
,
&
fd
);
hff
=
FindFirstFileW
(
input
,
&
fd
);
if
(
hff
==
INVALID_HANDLE_VALUE
)
if
(
hff
==
INVALID_HANDLE_VALUE
)
...
@@ -3207,7 +3207,7 @@ void WCMD_rename (void)
...
@@ -3207,7 +3207,7 @@ void WCMD_rename (void)
dotDst
=
wcschr
(
param2
,
'.'
);
dotDst
=
wcschr
(
param2
,
'.'
);
/* Split into components */
/* Split into components */
WCMD_
splitpath
(
input
,
drive
,
dir
,
fname
,
ext
);
_w
splitpath
(
input
,
drive
,
dir
,
fname
,
ext
);
hff
=
FindFirstFileW
(
input
,
&
fd
);
hff
=
FindFirstFileW
(
input
,
&
fd
);
if
(
hff
==
INVALID_HANDLE_VALUE
)
if
(
hff
==
INVALID_HANDLE_VALUE
)
...
@@ -3492,7 +3492,7 @@ void WCMD_setshow_default (const WCHAR *args) {
...
@@ -3492,7 +3492,7 @@ void WCMD_setshow_default (const WCHAR *args) {
/* Convert path into actual directory spec */
/* Convert path into actual directory spec */
GetFullPathNameW
(
string
,
ARRAY_SIZE
(
fpath
),
fpath
,
NULL
);
GetFullPathNameW
(
string
,
ARRAY_SIZE
(
fpath
),
fpath
,
NULL
);
WCMD_
splitpath
(
fpath
,
drive
,
dir
,
fname
,
ext
);
_w
splitpath
(
fpath
,
drive
,
dir
,
fname
,
ext
);
/* Rebuild path */
/* Rebuild path */
wsprintfW
(
string
,
fmt
,
drive
,
dir
,
fd
.
cFileName
);
wsprintfW
(
string
,
fmt
,
drive
,
dir
,
fd
.
cFileName
);
...
...
programs/cmd/directory.c
View file @
60b3db6b
...
@@ -166,8 +166,8 @@ static int __cdecl WCMD_dir_sort (const void *a, const void *b)
...
@@ -166,8 +166,8 @@ static int __cdecl WCMD_dir_sort (const void *a, const void *b)
WCHAR
extB
[
MAX_PATH
];
WCHAR
extB
[
MAX_PATH
];
/* Split into components */
/* Split into components */
WCMD_
splitpath
(
filea
->
cFileName
,
drive
,
dir
,
fname
,
extA
);
_w
splitpath
(
filea
->
cFileName
,
drive
,
dir
,
fname
,
extA
);
WCMD_
splitpath
(
fileb
->
cFileName
,
drive
,
dir
,
fname
,
extB
);
_w
splitpath
(
fileb
->
cFileName
,
drive
,
dir
,
fname
,
extB
);
result
=
lstrcmpiW
(
extA
,
extB
);
result
=
lstrcmpiW
(
extA
,
extB
);
}
}
...
@@ -819,7 +819,7 @@ void WCMD_directory (WCHAR *args)
...
@@ -819,7 +819,7 @@ void WCMD_directory (WCHAR *args)
thisEntry
->
next
=
NULL
;
thisEntry
->
next
=
NULL
;
/* Split into components */
/* Split into components */
WCMD_
splitpath
(
path
,
drive
,
dir
,
fname
,
ext
);
_w
splitpath
(
path
,
drive
,
dir
,
fname
,
ext
);
WINE_TRACE
(
"Path Parts: drive: '%s' dir: '%s' name: '%s' ext:'%s'
\n
"
,
WINE_TRACE
(
"Path Parts: drive: '%s' dir: '%s' name: '%s' ext:'%s'
\n
"
,
wine_dbgstr_w
(
drive
),
wine_dbgstr_w
(
dir
),
wine_dbgstr_w
(
drive
),
wine_dbgstr_w
(
dir
),
wine_dbgstr_w
(
fname
),
wine_dbgstr_w
(
ext
));
wine_dbgstr_w
(
fname
),
wine_dbgstr_w
(
ext
));
...
...
programs/cmd/wcmd.h
View file @
60b3db6b
...
@@ -117,7 +117,6 @@ WCHAR *WCMD_skip_leading_spaces (WCHAR *string);
...
@@ -117,7 +117,6 @@ WCHAR *WCMD_skip_leading_spaces (WCHAR *string);
BOOL
WCMD_keyword_ws_found
(
const
WCHAR
*
keyword
,
int
len
,
const
WCHAR
*
ptr
);
BOOL
WCMD_keyword_ws_found
(
const
WCHAR
*
keyword
,
int
len
,
const
WCHAR
*
ptr
);
void
WCMD_HandleTildaModifiers
(
WCHAR
**
start
,
BOOL
atExecute
);
void
WCMD_HandleTildaModifiers
(
WCHAR
**
start
,
BOOL
atExecute
);
void
WCMD_splitpath
(
const
WCHAR
*
path
,
WCHAR
*
drv
,
WCHAR
*
dir
,
WCHAR
*
name
,
WCHAR
*
ext
);
WCHAR
*
WCMD_strip_quotes
(
WCHAR
*
cmd
);
WCHAR
*
WCMD_strip_quotes
(
WCHAR
*
cmd
);
WCHAR
*
WCMD_LoadMessage
(
UINT
id
);
WCHAR
*
WCMD_LoadMessage
(
UINT
id
);
void
WCMD_strsubstW
(
WCHAR
*
start
,
const
WCHAR
*
next
,
const
WCHAR
*
insert
,
int
len
);
void
WCMD_strsubstW
(
WCHAR
*
start
,
const
WCHAR
*
next
,
const
WCHAR
*
insert
,
int
len
);
...
...
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