Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail From: =?ISO-8859-1?Q?Sven_K=F6hler?= Newsgroups: comp.lang.java.programmer Subject: Re: exec problem is JDK 1.7.0_21 Date: Fri, 26 Apr 2013 20:17:56 +0300 Lines: 22 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: news.dfncis.de LrgLwDD+r6llhrd7QavnTQDGIPiLhezDlDa0BmE1xod44xLIwOd6yf4nSv Cancel-Lock: sha1:drzBpZ8Ykv44Hup/c/W2co1q/ss= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130408 Thunderbird/17.0.5 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:23656 Am 24.04.2013 12:26, schrieb Steven Simpson: > There seems to be no way to escape a space other than enclosing the > entire argument in quotes. Once inside the quotes, there's no way to > escape anything else (like a literal quote), so there's no way to escape > an argument containing a space and a quote. Backslashes behave > literally everywhere. > > Is the program using CommandLineToArgvW incorrectly? Are there any > other input strings to try? I tested test(L"foo.exe \"ab\\\"c\\\\\" def"); test(L"\"foo.exe\" \"ab\\\"c\\\\\" def"); end then it works. Apparently, the first token (which is the program name, and can be assumed not to contain any backslashes and quotes) is treated differently from all subsequent tokens. So CommandLineToArgvW does allow for escaping quotes within the arguments. Regards, Sven