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
2cbcb323
Commit
2cbcb323
authored
Jul 10, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed handling of drives with "/" path (thanks to Marcus Meissner).
parent
0e8da891
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
drive.c
files/drive.c
+8
-8
No files found.
files/drive.c
View file @
2cbcb323
...
@@ -390,9 +390,9 @@ int DRIVE_FindDriveRoot( const char **path )
...
@@ -390,9 +390,9 @@ int DRIVE_FindDriveRoot( const char **path )
len
=
strlen
(
buffer
);
len
=
strlen
(
buffer
);
/* strip off trailing slashes */
/* strip off trailing slashes */
while
(
len
>
0
&&
buffer
[
len
-
1
]
==
'/'
)
buffer
[
--
len
]
=
0
;
while
(
len
>
1
&&
buffer
[
len
-
1
]
==
'/'
)
buffer
[
--
len
]
=
0
;
while
(
len
>
0
)
for
(;;
)
{
{
/* Find the drive */
/* Find the drive */
if
(
stat
(
buffer
,
&
st
)
==
0
&&
S_ISDIR
(
st
.
st_mode
))
if
(
stat
(
buffer
,
&
st
)
==
0
&&
S_ISDIR
(
st
.
st_mode
))
...
@@ -406,6 +406,7 @@ int DRIVE_FindDriveRoot( const char **path )
...
@@ -406,6 +406,7 @@ int DRIVE_FindDriveRoot( const char **path )
if
((
DOSDrives
[
drive
].
dev
==
st
.
st_dev
)
&&
if
((
DOSDrives
[
drive
].
dev
==
st
.
st_dev
)
&&
(
DOSDrives
[
drive
].
ino
==
st
.
st_ino
))
(
DOSDrives
[
drive
].
ino
==
st
.
st_ino
))
{
{
if
(
len
==
1
)
len
=
0
;
/* preserve root slash in returned 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
;
...
@@ -414,23 +415,22 @@ int DRIVE_FindDriveRoot( const char **path )
...
@@ -414,23 +415,22 @@ int DRIVE_FindDriveRoot( const char **path )
}
}
}
}
}
}
if
(
len
<=
1
)
return
-
1
;
/* reached root */
level
=
0
;
level
=
0
;
while
(
le
n
>
0
&&
le
vel
<
1
)
while
(
level
<
1
)
{
{
/* find start of the last path component */
/* find start of the last path component */
while
(
len
>
0
&&
buffer
[
len
-
1
]
!=
'/'
)
while
(
len
>
1
&&
buffer
[
len
-
1
]
!=
'/'
)
len
--
;
--
len
;
if
(
!
buffer
[
len
])
break
;
/* empty component -> reached root */
/* does removing it take us up a level? */
/* does removing it take us up a level? */
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 */
/* strip off trailing slashes */
while
(
len
>
0
&&
buffer
[
len
-
1
]
==
'/'
)
buffer
[
--
len
]
=
0
;
while
(
len
>
1
&&
buffer
[
len
-
1
]
==
'/'
)
buffer
[
--
len
]
=
0
;
}
}
}
}
return
-
1
;
}
}
...
...
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