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
5d531fc1
Commit
5d531fc1
authored
Nov 10, 2006
by
Francois Gouget
Committed by
Alexandre Julliard
Nov 27, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winepath: Fix --unix so it works whether the Windows path refers to an existing…
winepath: Fix --unix so it works whether the Windows path refers to an existing file/directory or not.
parent
86ba62a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
6 deletions
+53
-6
winepath.c
programs/winepath/winepath.c
+53
-6
No files found.
programs/winepath/winepath.c
View file @
5d531fc1
...
...
@@ -189,14 +189,61 @@ int wmain(int argc, const WCHAR *argv[])
printf
(
"%s
\n
"
,
path
);
}
if
(
outputformats
&
UNIXFORMAT
)
{
char
*
unix_name
;
if
((
unix_name
=
wine_get_unix_file_name_ptr
(
argv
[
i
])))
WCHAR
*
ntpath
,
*
tail
;
int
ntpathlen
=
lstrlenW
(
argv
[
i
]);
ntpath
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
ntpath
)
*
(
ntpathlen
+
1
));
lstrcpyW
(
ntpath
,
argv
[
i
]);
tail
=
NULL
;
while
(
1
)
{
printf
(
"%s
\n
"
,
unix_name
);
HeapFree
(
GetProcessHeap
(),
0
,
unix_name
);
char
*
unix_name
;
WCHAR
*
slash
,
*
c
;
unix_name
=
wine_get_unix_file_name_ptr
(
ntpath
);
if
(
unix_name
)
{
if
(
tail
)
{
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
tail
+
1
,
-
1
,
path
,
MAX_PATH
,
NULL
,
NULL
);
printf
(
"%s/%s
\n
"
,
unix_name
,
path
);
}
else
{
printf
(
"%s
\n
"
,
unix_name
);
}
HeapFree
(
GetProcessHeap
(),
0
,
unix_name
);
break
;
}
slash
=
(
tail
?
tail
:
ntpath
+
ntpathlen
);
while
(
slash
!=
ntpath
&&
*
slash
!=
'/'
&&
*
slash
!=
'\\'
)
slash
--
;
if
(
slash
==
ntpath
)
{
/* This is a complete path conversion failure.
* It would typically happen if ntpath == "".
*/
printf
(
"
\n
"
);
break
;
}
c
=
slash
+
1
;
while
(
*
c
!=
'\0'
&&
*
c
!=
'*'
&&
*
c
!=
'?'
&&
*
c
!=
'<'
&&
*
c
!=
'>'
&&
*
c
!=
'|'
&&
*
c
!=
'"'
)
c
++
;
if
(
*
c
!=
'\0'
)
{
/* If this is not a valid NT path to start with,
* then obviously we cannot convert it.
*/
printf
(
"
\n
"
);
break
;
}
if
(
tail
)
*
tail
=
'/'
;
tail
=
slash
;
*
tail
=
'\0'
;
}
else
printf
(
"
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
ntpath
);
}
if
(
outputformats
&
WINDOWSFORMAT
)
{
WCHAR
*
windows_name
;
...
...
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