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
ac971ecf
Commit
ac971ecf
authored
Jun 08, 2012
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better fix for isalpha in drive letter detection
Missed a place that used this and missed git__isalpha
parent
d17db71b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
src/path.c
+7
-4
No files found.
src/path.c
View file @
ac971ecf
...
...
@@ -17,6 +17,10 @@
#include <stdio.h>
#include <ctype.h>
#ifdef GIT_WIN32
#define LOOKS_LIKE_DRIVE_PREFIX(S) (git__isalpha((S)[0]) && (S)[1] == ':')
#endif
/*
* Based on the Android implementation, BSD licensed.
* Check http://android.git.kernel.org/
...
...
@@ -105,7 +109,7 @@ int git_path_dirname_r(git_buf *buffer, const char *path)
/* Mimic unix behavior where '/.git' returns '/': 'C:/.git' will return
'C:/' here */
if
(
len
==
2
&&
isalpha
(
path
[
0
])
&&
path
[
1
]
==
':'
)
{
if
(
len
==
2
&&
LOOKS_LIKE_DRIVE_PREFIX
(
path
)
)
{
len
=
3
;
goto
Exit
;
}
...
...
@@ -170,8 +174,7 @@ int git_path_root(const char *path)
#ifdef GIT_WIN32
/* Does the root of the path look like a windows drive ? */
if
(((
path
[
0
]
>=
'a'
&&
path
[
0
]
<=
'z'
)
||
(
path
[
0
]
>=
'A'
&&
path
[
0
]
<=
'Z'
))
&&
path
[
1
]
==
':'
)
if
(
LOOKS_LIKE_DRIVE_PREFIX
(
path
))
offset
+=
2
;
/* Are we dealing with a windows network path? */
...
...
@@ -211,7 +214,7 @@ int git_path_prettify(git_buf *path_out, const char *path, const char *base)
giterr_set
(
GITERR_OS
,
"Failed to resolve path '%s'"
,
path
);
git_buf_clear
(
path_out
);
return
error
;
}
...
...
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