diff options
author | Patrick Steinhardt <ps@pks.im> | 2020-05-12 21:35:07 +0200 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2020-05-12 21:37:18 +0200 |
commit | a2eca682825523df8a03119ccd319519b52d341f (patch) | |
tree | 7a5a82fae465f091e1ed831c720fbbc03eccc1d5 /src/futils.c | |
parent | 51a2bc4337c9ca7ff398add3f6b85ce974b4a8ac (diff) | |
download | libgit2-pks/futils-symlink-args.tar.gz |
futils: fix order of declared parameters for `git_futils_fake_symlink`pks/futils-symlink-args
While the function `git_futils_fake_symlink` is declared with arguments
`new, old`, the implementation uses the reverse order `old, new`. Let's
fix the ordering issues to be `new, old` for both, which matches what
symlink(3P) has. While at it, we also rename these parameters: `old` and
`new` doesn't really make a lot of sense in the context of symlinks,
which is why this commit renames them to be called `target` and `path`.
Diffstat (limited to 'src/futils.c')
-rw-r--r-- | src/futils.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/futils.c b/src/futils.c index a7c360a1c..8c0f008b3 100644 --- a/src/futils.c +++ b/src/futils.c @@ -834,12 +834,12 @@ int git_futils_rmdir_r( return error; } -int git_futils_fake_symlink(const char *old, const char *new) +int git_futils_fake_symlink(const char *target, const char *path) { int retcode = GIT_ERROR; - int fd = git_futils_creat_withpath(new, 0755, 0644); + int fd = git_futils_creat_withpath(path, 0755, 0644); if (fd >= 0) { - retcode = p_write(fd, old, strlen(old)); + retcode = p_write(fd, target, strlen(target)); p_close(fd); } return retcode; |