Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
23a1edbd
Commit
23a1edbd
authored
Dec 21, 2010
by
nulltoken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrapped the detection of a Windows rooted path within a conditional compilation directive.
parent
f2d6a23a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
src/fileops.c
+19
-3
No files found.
src/fileops.c
View file @
23a1edbd
...
...
@@ -312,6 +312,19 @@ int gitfo_dirent(
return
GIT_SUCCESS
;
}
#ifdef GIT_WIN32
static
int
is_windows_rooted_path
(
const
char
*
path
)
{
/* Does the root of the path look like a windows drive ? */
if
(
isalpha
(
path
[
0
])
&&
(
path
[
1
]
==
':'
)
&&
(
path
[
2
]
==
'/'
))
return
GIT_SUCCESS
;
return
GIT_ERROR
;
}
#endif
int
gitfo_mkdir_recurs
(
const
char
*
path
,
int
mode
)
{
int
error
;
...
...
@@ -324,9 +337,12 @@ int gitfo_mkdir_recurs(const char *path, int mode)
error
=
GIT_SUCCESS
;
pp
=
path_copy
;
/* Does the root of the path look like a windows drive ? */
if
(
isalpha
(
pp
[
0
])
&&
(
pp
[
1
]
==
':'
)
&&
(
pp
[
2
]
==
'/'
))
pp
+=
2
;
#ifdef GIT_WIN32
if
(
!
is_windows_rooted_path
(
pp
))
pp
+=
2
;
/* Skip the drive name (eg. C: or D:) */
#endif
while
(
error
==
GIT_SUCCESS
&&
(
sp
=
strchr
(
pp
,
'/'
))
!=
0
)
{
if
(
sp
!=
pp
&&
gitfo_isdir
(
path_copy
)
<
GIT_SUCCESS
)
{
...
...
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