From b5cd41cdf4e6afd475fe34b755f99578e20b08ca Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Mon, 1 Mar 2021 09:37:50 +0000 Subject: libbb: fix detection of relative paths in xreadlink.c 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. --- libbb/xreadlink.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libbb') 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) return NULL; } +#if ENABLE_PLATFORM_MINGW32 + if (!is_absolute_path(linkpath)) { +#else if (*linkpath != '/') { +#endif bufsize += strlen(linkpath); buf = xrealloc(buf, bufsize); lpc = bb_get_last_path_component_strip(buf); -- cgit v1.2.3-55-g6feb