mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-30 06:13:36 +00:00
Made gitfo_mkdir_recurs() skip creation of the root of the path if it looks like a Windows drive.
This commit is contained in:
parent
412de9a637
commit
2e29957a79
@ -1,5 +1,6 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "fileops.h"
|
#include "fileops.h"
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
int gitfo_open(const char *path, int flags)
|
int gitfo_open(const char *path, int flags)
|
||||||
{
|
{
|
||||||
@ -323,6 +324,10 @@ int gitfo_mkdir_recurs(const char *path, int mode)
|
|||||||
error = GIT_SUCCESS;
|
error = GIT_SUCCESS;
|
||||||
pp = path_copy;
|
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) {
|
while (error == GIT_SUCCESS && (sp = strchr(pp, '/')) != 0) {
|
||||||
if (sp != pp && gitfo_isdir(path_copy) < GIT_SUCCESS) {
|
if (sp != pp && gitfo_isdir(path_copy) < GIT_SUCCESS) {
|
||||||
*sp = 0;
|
*sp = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user