aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2012-10-05 11:18:05 +0100
committerRon Yorston <rmy@pobox.com>2012-10-05 11:18:05 +0100
commit239bba0059e5c8284c7f21e2b65b0467b20c6bd7 (patch)
treec19ff4fbe7ccfd2c453bfc291d6d375e54249edf /libbb
parent01366408c9df773897bdd669cd4371d099f483bb (diff)
downloadbusybox-w32-239bba0059e5c8284c7f21e2b65b0467b20c6bd7.tar.gz
busybox-w32-239bba0059e5c8284c7f21e2b65b0467b20c6bd7.tar.bz2
busybox-w32-239bba0059e5c8284c7f21e2b65b0467b20c6bd7.zip
Revised quoting of command line arguments for WIN32
* We only need to quote an argument if it contains whitespace. * There's no point in quoting ? or * because Windows still expands them. Anyhow, if the command line comes from a BusyBox shell it will usually have handled the globbing, so we should turn off Windows globbing for any wildcard that has made it through the shell without expansion. This means that BusyBox commands run from cmd.exe won't do wildcard expansion, though. * Backslashes only need to be doubled if they occur immediately before double quotes. * Double quotes need to be escaped with a backslash.
Diffstat (limited to 'libbb')
-rw-r--r--libbb/appletlib.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 0c0d14499..9f3584755 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -773,6 +773,11 @@ void FAST_FUNC run_applet_and_exit(const char *name, char **argv)
773#if ENABLE_BUILD_LIBBUSYBOX 773#if ENABLE_BUILD_LIBBUSYBOX
774int lbb_main(char **argv) 774int lbb_main(char **argv)
775#else 775#else
776#if ENABLE_PLATFORM_MINGW32
777/* disable MSVCRT command line globbing */
778int _CRT_glob = 0;
779#endif
780
776int main(int argc UNUSED_PARAM, char **argv) 781int main(int argc UNUSED_PARAM, char **argv)
777#endif 782#endif
778{ 783{