diff options
| author | The rugged tests are fragile <tanoku@gmail.com> | 2014-09-17 14:52:31 +0200 |
|---|---|---|
| committer | The rugged tests are fragile <tanoku@gmail.com> | 2014-09-17 15:00:12 +0200 |
| commit | bbb988a5190be2a8763c60cb37c52466a39f6441 (patch) | |
| tree | 691ad5fcfc3097bf2d593d280fa64f808b27dbf5 /src/fileops.c | |
| parent | 1312f87b6838649cca525935656c84c7bd07a9a1 (diff) | |
| download | libgit2-bbb988a5190be2a8763c60cb37c52466a39f6441.tar.gz | |
path: Fix `git_path_walk_up` to work with non-rooted paths
Diffstat (limited to 'src/fileops.c')
| -rw-r--r-- | src/fileops.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fileops.c b/src/fileops.c index 34659ad3b..bd9d27c7a 100644 --- a/src/fileops.c +++ b/src/fileops.c @@ -505,15 +505,15 @@ static int futils__rmdir_recurs_foreach(void *opaque, git_buf *path) return error; } -static int futils__rmdir_empty_parent(void *opaque, git_buf *path) +static int futils__rmdir_empty_parent(void *opaque, const char *path) { futils__rmdir_data *data = opaque; int error = 0; - if (git_buf_len(path) <= data->baselen) + if (strlen(path) <= data->baselen) error = GIT_ITEROVER; - else if (p_rmdir(git_buf_cstr(path)) < 0) { + else if (p_rmdir(path) < 0) { int en = errno; if (en == ENOENT || en == ENOTDIR) { @@ -521,7 +521,7 @@ static int futils__rmdir_empty_parent(void *opaque, git_buf *path) } else if (en == ENOTEMPTY || en == EEXIST || en == EBUSY) { error = GIT_ITEROVER; } else { - error = git_path_set_error(errno, git_buf_cstr(path), "rmdir"); + error = git_path_set_error(errno, path, "rmdir"); } } |
