aboutsummaryrefslogtreecommitdiff
path: root/libbb/xreadlink.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2019-06-25 18:51:00 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2019-06-25 18:51:00 +0200
commit25a871fb402012325654ed82e568c337bc426848 (patch)
treecde2aee4ac68c1f01dba7747226583a887e8324d /libbb/xreadlink.c
parent3a0eea0887d72f28d13d329be90fe4082cbbd427 (diff)
downloadbusybox-25a871fb402012325654ed82e568c337bc426848.tar.gz
libbb: deal with "declaration of 'link' shadows a global declaration" warning
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/xreadlink.c')
-rw-r--r--libbb/xreadlink.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libbb/xreadlink.c b/libbb/xreadlink.c
index a4e402b84..a18dd0748 100644
--- a/libbb/xreadlink.c
+++ b/libbb/xreadlink.c
@@ -148,10 +148,10 @@ char* FAST_FUNC xmalloc_realpath_coreutils(const char *path)
strcpy(buf + len, last_slash);
}
} else {
- char *link = xmalloc_readlink(path);
- if (link) {
+ char *target = xmalloc_readlink(path);
+ if (target) {
char *cwd;
- if (link[0] == '/') {
+ if (target[0] == '/') {
/*
* $ ln -s /bin/qwe symlink # note: /bin is a link to /usr/bin
* $ readlink -f symlink
@@ -159,8 +159,8 @@ char* FAST_FUNC xmalloc_realpath_coreutils(const char *path)
* $ realpath symlink
* /usr/bin/qwe/target_does_not_exist
*/
- buf = xmalloc_realpath_coreutils(link);
- free(link);
+ buf = xmalloc_realpath_coreutils(target);
+ free(target);
return buf;
}
/*
@@ -171,9 +171,9 @@ char* FAST_FUNC xmalloc_realpath_coreutils(const char *path)
* /CURDIR/target_does_not_exist
*/
cwd = xrealloc_getcwd_or_warn(NULL);
- buf = concat_path_file(cwd, link);
+ buf = concat_path_file(cwd, target);
free(cwd);
- free(link);
+ free(target);
return buf;
}
}