delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
DomainKey-Signature: | a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:message-id:date:from:mime-version:to:subject | |
:references:in-reply-to:content-type:content-transfer-encoding; | |
q=dns; s=default; b=lie0eQl2n5IAzRkc8ejDAeHRYW3lvdGtOdu250HmnfN | |
bCDodCEVWQ3K9s/HO33UqrPfRZm+ns4C44PUcik0Dp5Yy+HUm4frI0hWjozoH/3L | |
GE5I3gG6lp9Jz6HFO2gWn9nwISgessJp3q8W0PQiQmhnaWN0X5xFxYk4XedbNPx0 | |
= | |
DKIM-Signature: | v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:message-id:date:from:mime-version:to:subject | |
:references:in-reply-to:content-type:content-transfer-encoding; | |
s=default; bh=Q7mMhLm6HOcwZ0aS1sKyyaEVcrI=; b=tMaTwff/cM6exSUrM | |
0C0VKF8ffO07GwqO6IveqGJH4oNHdv0cJVex1EKycrxnskkfx0vFYMETLW4gXd+x | |
JeclPHnnE2kszVVCBb4vyVo5cYj0uCAy2WACwnMKHvZaiwK5L4P1AyorgZeM9STr | |
36nOh1A66ze6vzzGjZXPzTtDxc= | |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
Authentication-Results: | sourceware.org; auth=none |
X-Virus-Found: | No |
X-Spam-SWARE-Status: | No, score=-1.0 required=5.0 tests=AWL,BAYES_20,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 |
X-HELO: | mail.lysator.liu.se |
Message-ID: | <54EF933B.1060708@lysator.liu.se> |
Date: | Thu, 26 Feb 2015 22:42:19 +0100 |
From: | Peter Rosin <peda AT lysator DOT liu DOT se> |
User-Agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
MIME-Version: | 1.0 |
To: | cygwin AT cygwin DOT com |
Subject: | Re: Why does CYGWIN double the backslash in execvp()? |
References: | <CAKVG1_rma3GmO9JDbB0qCE_m0wwYm3vT5+QbxYhchrMLrkORDQ AT mail DOT gmail DOT com> <CAKVG1_oTsxvqFpjZ2Kbn5fuuU9ryotHVGYB_0ymhFu5Wh5cm0g AT mail DOT gmail DOT com> |
In-Reply-To: | <CAKVG1_oTsxvqFpjZ2Kbn5fuuU9ryotHVGYB_0ymhFu5Wh5cm0g@mail.gmail.com> |
On 2015-02-26 21:59, A L wrote: > Hi, > Yesterday I asked about the double slash, but my question has got no > attention (despite some other activity > on the list). I deem the behavior as a bug. To make things more > evident (that it's a bug) one can replace "DIR" > with "ECHO" in the code I posted, and compare the outputs with and > without BUG defined... I'd really appreciate > if someone could take a look at it, or explain me why my expectations > were wrong. When you say "/cygdrive/c/windows/system32/cmd.exe" you tell Cygwin that you want posix semantics. Which you don't. Try "c:/windows/system32/cmd.exe" or split arg 2 into two args: "DIR" and "C:\\", like so: #include <stdio.h> #include <unistd.h> #define NOBUG int main() { const char* args[5]; char** xargs; args[0] = "/cygdrive/c/Windows/System32/cmd.exe"; args[1] = "/c"; args[2] = "DIR"; #ifdef NOBUG args[3] = "C:\\"; #else args[3] = "C:\\."; #endif args[4] = 0; printf("Command = \"%s %s %s %s\"\n", args[0], args[1], args[2], args[3]); xargs = (char**) &args; execvp(args[0], xargs); return 0; } I think that cmd.exe has a non-standard grasp of how command lines should be handled and Cygwin cannot make exceptions for individual applications, that would be a never-ending maze. Cheers, Peter -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |