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
dcf0beac
Commit
dcf0beac
authored
Jun 20, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure that DRIVE_FindDriveRoot always returns an absolute path.
parent
4b9cc868
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
18 deletions
+8
-18
dos_fs.c
files/dos_fs.c
+2
-15
drive.c
files/drive.c
+6
-3
No files found.
files/dos_fs.c
View file @
dcf0beac
...
@@ -867,7 +867,6 @@ static int DOSFS_GetPathDrive( const char **name )
...
@@ -867,7 +867,6 @@ static int DOSFS_GetPathDrive( const char **name )
*/
*/
BOOL
DOSFS_GetFullName
(
LPCSTR
name
,
BOOL
check_last
,
DOS_FULL_NAME
*
full
)
BOOL
DOSFS_GetFullName
(
LPCSTR
name
,
BOOL
check_last
,
DOS_FULL_NAME
*
full
)
{
{
BOOL
unixabsolute
=
*
name
==
'/'
;
BOOL
found
;
BOOL
found
;
UINT
flags
;
UINT
flags
;
char
*
p_l
,
*
p_s
,
*
root
;
char
*
p_l
,
*
p_s
,
*
root
;
...
@@ -895,7 +894,7 @@ BOOL DOSFS_GetFullName( LPCSTR name, BOOL check_last, DOS_FULL_NAME *full )
...
@@ -895,7 +894,7 @@ BOOL DOSFS_GetFullName( LPCSTR name, BOOL check_last, DOS_FULL_NAME *full )
{
{
while
((
*
name
==
'\\'
)
||
(
*
name
==
'/'
))
name
++
;
while
((
*
name
==
'\\'
)
||
(
*
name
==
'/'
))
name
++
;
}
}
else
if
(
!
unixabsolute
)
/* Relative path */
else
/* Relative path */
{
{
lstrcpynA
(
root
+
1
,
DRIVE_GetUnixCwd
(
full
->
drive
),
lstrcpynA
(
root
+
1
,
DRIVE_GetUnixCwd
(
full
->
drive
),
sizeof
(
full
->
long_name
)
-
(
root
-
full
->
long_name
)
-
1
);
sizeof
(
full
->
long_name
)
-
(
root
-
full
->
long_name
)
-
1
);
...
@@ -1028,7 +1027,6 @@ DWORD WINAPI GetShortPathNameA( LPCSTR longpath, LPSTR shortpath,
...
@@ -1028,7 +1027,6 @@ DWORD WINAPI GetShortPathNameA( LPCSTR longpath, LPSTR shortpath,
DWORD
sp
=
0
,
lp
=
0
;
DWORD
sp
=
0
,
lp
=
0
;
int
tmplen
,
drive
;
int
tmplen
,
drive
;
UINT
flags
;
UINT
flags
;
BOOL
unixabsolute
=
*
longpath
==
'/'
;
TRACE
(
"%s
\n
"
,
debugstr_a
(
longpath
));
TRACE
(
"%s
\n
"
,
debugstr_a
(
longpath
));
...
@@ -1046,22 +1044,12 @@ DWORD WINAPI GetShortPathNameA( LPCSTR longpath, LPSTR shortpath,
...
@@ -1046,22 +1044,12 @@ DWORD WINAPI GetShortPathNameA( LPCSTR longpath, LPSTR shortpath,
return
0
;
return
0
;
}
}
/* check for drive letter */
if
(
longpath
[
1
]
==
':'
)
{
tmpshortpath
[
0
]
=
longpath
[
0
];
tmpshortpath
[
1
]
=
':'
;
sp
=
2
;
}
if
(
(
drive
=
DOSFS_GetPathDrive
(
&
longpath
))
==
-
1
)
return
0
;
if
(
(
drive
=
DOSFS_GetPathDrive
(
&
longpath
))
==
-
1
)
return
0
;
flags
=
DRIVE_GetFlags
(
drive
);
flags
=
DRIVE_GetFlags
(
drive
);
if
(
unixabsolute
)
{
tmpshortpath
[
0
]
=
drive
+
'A'
;
tmpshortpath
[
0
]
=
drive
+
'A'
;
tmpshortpath
[
1
]
=
':'
;
tmpshortpath
[
1
]
=
':'
;
tmpshortpath
[
2
]
=
'\\'
;
sp
=
2
;
sp
=
3
;
}
while
(
longpath
[
lp
]
)
{
while
(
longpath
[
lp
]
)
{
...
@@ -2431,4 +2419,3 @@ BOOL16 WINAPI FindClose16( HANDLE16 handle )
...
@@ -2431,4 +2419,3 @@ BOOL16 WINAPI FindClose16( HANDLE16 handle )
GlobalFree16
(
handle
);
GlobalFree16
(
handle
);
return
TRUE
;
return
TRUE
;
}
}
files/drive.c
View file @
dcf0beac
...
@@ -388,6 +388,9 @@ int DRIVE_FindDriveRoot( const char **path )
...
@@ -388,6 +388,9 @@ int DRIVE_FindDriveRoot( const char **path )
*
p
=
'/'
;
*
p
=
'/'
;
len
=
strlen
(
buffer
);
len
=
strlen
(
buffer
);
/* strip off trailing slashes */
while
(
len
>
0
&&
buffer
[
len
-
1
]
==
'/'
)
buffer
[
--
len
]
=
0
;
while
(
len
>
0
)
while
(
len
>
0
)
{
{
/* Find the drive */
/* Find the drive */
...
@@ -405,6 +408,7 @@ int DRIVE_FindDriveRoot( const char **path )
...
@@ -405,6 +408,7 @@ int DRIVE_FindDriveRoot( const char **path )
TRACE
(
"%s -> drive %c:, root='%s', name='%s'
\n
"
,
TRACE
(
"%s -> drive %c:, root='%s', name='%s'
\n
"
,
*
path
,
'A'
+
drive
,
buffer
,
*
path
+
len
);
*
path
,
'A'
+
drive
,
buffer
,
*
path
+
len
);
*
path
+=
len
;
*
path
+=
len
;
if
(
!**
path
)
*
path
=
"
\\
"
;
return
drive
;
return
drive
;
}
}
}
}
...
@@ -413,9 +417,6 @@ int DRIVE_FindDriveRoot( const char **path )
...
@@ -413,9 +417,6 @@ int DRIVE_FindDriveRoot( const char **path )
level
=
0
;
level
=
0
;
while
(
len
>
0
&&
level
<
1
)
while
(
len
>
0
&&
level
<
1
)
{
{
/* strip off a trailing slash */
while
(
len
>
0
&&
buffer
[
len
-
1
]
==
'/'
)
buffer
[
--
len
]
=
0
;
/* find start of the last path component */
/* find start of the last path component */
while
(
len
>
0
&&
buffer
[
len
-
1
]
!=
'/'
)
while
(
len
>
0
&&
buffer
[
len
-
1
]
!=
'/'
)
--
len
;
--
len
;
...
@@ -423,6 +424,8 @@ int DRIVE_FindDriveRoot( const char **path )
...
@@ -423,6 +424,8 @@ int DRIVE_FindDriveRoot( const char **path )
if
(
strcmp
(
buffer
+
len
,
"."
)
!=
0
)
if
(
strcmp
(
buffer
+
len
,
"."
)
!=
0
)
level
+=
strcmp
(
buffer
+
len
,
".."
)
?
1
:
-
1
;
level
+=
strcmp
(
buffer
+
len
,
".."
)
?
1
:
-
1
;
buffer
[
len
]
=
0
;
buffer
[
len
]
=
0
;
/* strip off trailing slashes */
while
(
len
>
0
&&
buffer
[
len
-
1
]
==
'/'
)
buffer
[
--
len
]
=
0
;
}
}
}
}
...
...
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