aboutsummaryrefslogtreecommitdiff
path: root/libbb/xreadlink.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-03-01 09:37:50 +0000
committerRon Yorston <rmy@pobox.com>2021-03-01 09:37:50 +0000
commitb5cd41cdf4e6afd475fe34b755f99578e20b08ca (patch)
tree669463610c986ce3c1257ab02c2e51621b0bbef9 /libbb/xreadlink.c
parent4986a1248dcdb6f32a22321154dc26898f10d3ab (diff)
downloadbusybox-w32-symlink.tar.gz
busybox-w32-symlink.tar.bz2
busybox-w32-symlink.zip
libbb: fix detection of relative paths in xreadlink.csymlink
In xmalloc_follow_symlinks() the code to detect relative paths needs to be altered for WIN32. We don't want C:/path to be treated as a relative path.
Diffstat (limited to 'libbb/xreadlink.c')
-rw-r--r--libbb/xreadlink.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libbb/xreadlink.c b/libbb/xreadlink.c
index ca53e12d3..f0a63fd9b 100644
--- a/libbb/xreadlink.c
+++ b/libbb/xreadlink.c
@@ -76,7 +76,11 @@ char* FAST_FUNC xmalloc_follow_symlinks(const char *path)
76 return NULL; 76 return NULL;
77 } 77 }
78 78
79#if ENABLE_PLATFORM_MINGW32
80 if (!is_absolute_path(linkpath)) {
81#else
79 if (*linkpath != '/') { 82 if (*linkpath != '/') {
83#endif
80 bufsize += strlen(linkpath); 84 bufsize += strlen(linkpath);
81 buf = xrealloc(buf, bufsize); 85 buf = xrealloc(buf, bufsize);
82 lpc = bb_get_last_path_component_strip(buf); 86 lpc = bb_get_last_path_component_strip(buf);