X-Recipient: archive-cygwin@delorie.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:from:to:subject:date:message-id:references
	:content-type:content-transfer-encoding:mime-version; q=dns; s=
	default; b=TrZ3x6/4BSI2rhdFKAIimu4I7Bq9nM+CUZSVACwSMSkbT43ZnLKEy
	D1brrXyKwMWnVg6zNt3rdw52jcufGriLNWa6g3J+zjy9PQji65SkQvHNk11sAtEN
	F3npjKKwZroEHTVKEzgigibpKEnuUyokJsIo9icz3Fs97hPzFxcU9w=
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:from:to:subject:date:message-id:references
	:content-type:content-transfer-encoding:mime-version; s=default;
	 bh=uAP2w72n8K1P5J3Wq2ssf5sWTxU=; b=OKDsFfyslODcJ0G5zFDSkAGwhQdU
	ow7eLyJUmrQlmzXjfAAevN+pVVOIxfJN9iYIXrzeRkvsPkScqYT/vOcnuINKmk1k
	AROPLEn9BS074UMBKTnYKNdwCMKbQe8FiqLAI7faUtw2L6JjAgP3RO1OZJYZii19
	VD9d/24BRLZBXr8=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=AWL,BAYES_00,MIME_BASE64_BLANKS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2
X-HELO: mailuogwdur.emc.com
X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd51.lss.emc.com tARGtPQe003428
X-DKIM: OpenDKIM Filter v2.4.3 mailuogwprd51.lss.emc.com tARGtPQe003428
From: "Gluszczak, Glenn" <glenn.gluszczak@emc.com>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>
Subject: RE: Argument parsing with gcc compiled program
Date: Fri, 27 Nov 2015 16:55:13 +0000
Message-ID: <91DCAC3CB99C724EB365BB64677FBE7B01DFDC@MX204CL04.corp.emc.com>
References: <CAO1jNwu2RXpCn2JuaZEhGaFA4_UTW9dxPxRcoasRuUBwgbRQgA@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
X-Sentrion-Hostname: mailusrhubprd02.lss.emc.com
X-RSA-Classifications: public
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id tARGtdUx012816

>On Fri, Nov 27, 2015 at 5:03 PM, Gluszczak, Glenn  wrote:

> Please look at my example again.  The same program compiled with Visual Studio does *not*
> strip out the backslash whether run in cmd.exe or bash.exe.  Other utilities like Perl
> do not strip out the backslash either.  It is only programs I compile with Cygwin gcc that do this.

>Windows Perl or Cygwin Perl ?
>
>Csaba

You're correct about Perl, my bad.  My path in my CMD was pointing to Windows Perl.
Windows Perl does not strip out the backslash. Cygwin Perl is stripping out the backslash.

$ cat a.pl
$pcount = 0;
while ( $pcount <= ($#ARGV )) {
    printf("%s\n",$ARGV[$pcount]);
    $pcount ++;
}

$ perl a.pl -s "dsfgdsfgfsg d\:\\hello"
-s
dsfgdsfgfsg d\:\hello

K:\> c:\cygwin\bin\perl a.pl -s "dsfgdsfgfsg d\:\\hello"
-s
dsfgdsfgfsg d\:\hello

So if I compile with MS Visual Studio, binaries do not strip backslashes out of
arguments whether run in bash or cmd.  

If I compile with Cygwin gcc, backslashes are stripped whether in bash or cmd.

This looks like a compiler issue to me unless someone knows of an option.


