From 5a48290d9bdb827657114c24aa75c67bb1bd0ea7 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Thu, 13 Aug 2020 11:19:40 +0100 Subject: which: handle paths of form 'c:path' Add another case where paths of the form 'c:path' need special treatment. Adds 16 bytes. --- debianutils/which.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/debianutils/which.c b/debianutils/which.c index d749a2c7e..590d50683 100644 --- a/debianutils/which.c +++ b/debianutils/which.c @@ -67,8 +67,11 @@ int which_main(int argc UNUSED_PARAM, char **argv) #endif /* If file contains a slash don't use PATH */ - if (strchr(*argv, '/') || (ENABLE_PLATFORM_MINGW32 && strchr(*argv, '\\'))) { -#if ENABLE_PLATFORM_MINGW32 +#if !ENABLE_PLATFORM_MINGW32 + if (strchr(*argv, '/')) { +#else + if (strchr(*argv, '/') || strchr(*argv, '\\') || + has_dos_drive_prefix(*argv)) { if ((p=auto_win32_extension(*argv)) != NULL) { missing = 0; puts(bs_to_slash(p)); -- cgit v1.2.3-55-g6feb