From f9569be1e5ca929d68e28064be3ffadcb0aff784 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Wed, 18 Mar 2020 10:48:44 +0000 Subject: win32: improve handling of 'c:file' paths for executables bb_basename() didn't properly handle paths of the form 'c:file'. Attempting to run 'c:busybox' resulted in 'c:busybox: applet not found'. The shell had a similar problem: trying to run 'c:busybox' reported 'sh: c:busybox: not found'. --- libbb/get_last_path_component.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libbb/get_last_path_component.c') diff --git a/libbb/get_last_path_component.c b/libbb/get_last_path_component.c index 3a9b9237e..00649620d 100644 --- a/libbb/get_last_path_component.c +++ b/libbb/get_last_path_component.c @@ -13,7 +13,7 @@ const char* FAST_FUNC bb_basename(const char *name) #if ENABLE_PLATFORM_MINGW32 const char *cp; for (cp = name; *cp; cp++) - if (*cp == '/' || *cp == '\\') + if (*cp == '/' || *cp == '\\' || *cp == ':') name = cp + 1; #else const char *cp = strrchr(name, '/'); -- cgit v1.2.3-55-g6feb