summaryrefslogtreecommitdiff
path: root/src/fileops.c
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2010-12-20 10:56:32 +0100
committernulltoken <emeric.fermas@gmail.com>2010-12-20 10:56:32 +0100
commit2e29957a79592959c7b297722618536f8d977e88 (patch)
treee01f912c8a73d6b9289c1f18e53e72c630058382 /src/fileops.c
parent412de9a637e94b877c7762d90c87525f35018083 (diff)
downloadlibgit2-2e29957a79592959c7b297722618536f8d977e88.tar.gz
Made gitfo_mkdir_recurs() skip creation of the root of the path if it looks like a Windows drive.
Diffstat (limited to 'src/fileops.c')
-rw-r--r--src/fileops.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/fileops.c b/src/fileops.c
index f2a08e8fb..c5cc73ef2 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -1,5 +1,6 @@
#include "common.h"
#include "fileops.h"
+#include <ctype.h>
int gitfo_open(const char *path, int flags)
{
@@ -323,6 +324,10 @@ 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;
+
while (error == GIT_SUCCESS && (sp = strchr(pp, '/')) != 0) {
if (sp != pp && gitfo_isdir(path_copy) < GIT_SUCCESS) {
*sp = 0;