summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-02-04 12:44:32 +0000
committerRon Yorston <rmy@pobox.com>2019-02-04 12:44:32 +0000
commit19712b74259ef63e115fd55540c808e604b2f7c9 (patch)
tree564ef3902ecb5793598d502785d5550348721bf2
parent93a63809f9146e39a1c36bdccdfb8ef3b7046c98 (diff)
downloadbusybox-w32-19712b74259ef63e115fd55540c808e604b2f7c9.tar.gz
busybox-w32-19712b74259ef63e115fd55540c808e604b2f7c9.tar.bz2
busybox-w32-19712b74259ef63e115fd55540c808e604b2f7c9.zip
which: standardise slashes in output
Closes GitHub issue #21.
-rw-r--r--debianutils/which.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/debianutils/which.c b/debianutils/which.c
index 14d452cd5..b26f2f0f5 100644
--- a/debianutils/which.c
+++ b/debianutils/which.c
@@ -69,13 +69,20 @@ int which_main(int argc UNUSED_PARAM, char **argv)
69#if ENABLE_PLATFORM_MINGW32 69#if ENABLE_PLATFORM_MINGW32
70 if ((p=auto_win32_extension(*argv)) != NULL) { 70 if ((p=auto_win32_extension(*argv)) != NULL) {
71 missing = 0; 71 missing = 0;
72 convert_slashes(p);
72 puts(p); 73 puts(p);
73 } 74 }
74 else 75 else
75#endif 76#endif
76 if (file_is_executable(*argv)) { 77 if (file_is_executable(*argv)) {
77 missing = 0; 78 missing = 0;
79#if ENABLE_PLATFORM_MINGW32
80 p = auto_string(xstrdup(*argv));
81 convert_slashes(p);
82 puts(p);
83#else
78 puts(*argv); 84 puts(*argv);
85#endif
79 } 86 }
80 } else { 87 } else {
81 char *path; 88 char *path;
@@ -84,6 +91,9 @@ int which_main(int argc UNUSED_PARAM, char **argv)
84 /* NOFORK NB: xmalloc inside find_executable(), must have no allocs above! */ 91 /* NOFORK NB: xmalloc inside find_executable(), must have no allocs above! */
85 while ((p = find_executable(*argv, &path)) != NULL) { 92 while ((p = find_executable(*argv, &path)) != NULL) {
86 missing = 0; 93 missing = 0;
94#if ENABLE_PLATFORM_MINGW32
95 convert_slashes(p);
96#endif
87 puts(p); 97 puts(p);
88 free(p); 98 free(p);
89 if (!option_mask32) /* -a not set */ 99 if (!option_mask32) /* -a not set */