History log of /external/qemu/android/utils/win32_cmdline_quote_unittest.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
7745b32edeb9ec1c2763030bb42a8fc0c3e6d8c4 22-Jan-2014 David 'Digit' Turner <digit@google.com> Fix Windows command-line quoting.

When the 'emulator.exe' program invokes the real emulation program
(e.g. 'emulator-arm.exe' or 'emulator-x86.exe'), it passes its own
command-line arguments through execv().

Unfortunately, on Windows this doesn't work, as the command-line
arguments must be quoted in a special way. This is describ
is described in detail in the MSDN blog post named
"Everyone quotes command line arguments the wrong way" [1]

The code under android/main-emulator.c had several problems:

- It only quoted the first parameter (the program name), but
not any other one.

- The quoting was too naive to work in the general case.

This patch adds a utility function named win32_cmdline_quote()
to perform correct quoting, and changes android/main-emulator.c
to use it.

Fix for http://b.android.com/18317

[1] http://blogs.msdn.com/b/twistylittlepassagesallalike/archive/2011/04/23/everyone-quotes-arguments-the-wrong-way.aspx

Change-Id: I7cfd6ddd10706c7aeb6c7df56e20398277d78409
/external/qemu/android/utils/win32_cmdline_quote_unittest.cpp