From 26722dde31c3467cd31a078662810927eec05de5 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Thu, 24 Feb 2011 16:40:20 +0100 Subject: Quote concatenated QEMU options when -verbose is used. Change-Id: I2d95fa0aa9a5f679372dfd1ae7c7cec906c3049d --- android/main.c | 9 ++++++++- sockets.c | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/android/main.c b/android/main.c index a061ecf..198212f 100644 --- a/android/main.c +++ b/android/main.c @@ -865,7 +865,14 @@ int main(int argc, char **argv) /* Dump final command-line option to make debugging the core easier */ printf("Concatenated QEMU options:\n"); for (i = 0; i < n; i++) { - printf(" %s", args[i]); + /* To make it easier to copy-paste the output to a command-line, + * quote anything that contains spaces. + */ + if (strchr(args[i], ' ') != NULL) { + printf(" '%s'", args[i]); + } else { + printf(" %s", args[i]); + } } printf("\n"); } diff --git a/sockets.c b/sockets.c index e1f7ad3..1063339 100644 --- a/sockets.c +++ b/sockets.c @@ -130,7 +130,7 @@ _fix_errno( void ) const WinsockError* werr = _winsock_errors; int unix = EINVAL; /* generic error code */ - winsock_error = WSAGetLastError(); + winsock_error = WSAGetLastError(); for ( ; werr->string != NULL; werr++ ) { if (werr->winsock == winsock_error) { -- cgit v1.1