delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/08/25/17:11:55

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>,
<http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
From: JRSON AT NetZero DOT Net (John R Hanson)
To: Rob Tulloh <rob_tulloh AT dev DOT tivoli DOT com>
Cc: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: B20.1 sh and bash command line parsing question
Date: Wed, 25 Aug 1999 21:01:46 GMT
Reply-To: JRSON AT NetZero DOT Net
Message-ID: <37c855de.11173833@smtp.netzero.net>
References: <19990825133902 DOT 3055 DOT rocketmail AT send205 DOT yahoomail DOT com> <37C41060 DOT B6C87BC5 AT dev DOT tivoli DOT com> <37C420F5 DOT D7B44599 AT dev DOT tivoli DOT com>
In-Reply-To: <37C420F5.D7B44599@dev.tivoli.com>
X-Mailer: Forte Agent 1.5/32.452
MIME-Version: 1.0
Note-from-DJ: This may be spam

Rob PLEASE do not cater to this
cygwin BUG!!

Possibly if enough people complain
Someone will fix the command line
quoting in cygwin so it IS microsoft 
compatible.

Currently you cannot quote command lines
to ANY mingw32 or vc++ compiled program
using cygwin. This SUCKS!!

BTW you have probably already fixed this
but I think there is a missing line in sub_proc.c
that causes \" quoted variables to get an extra \
in front. Anyway this fixed my configure problem ;-)

all:;echo \"$(a)\"

diff -urbBPx RCS ../make.org/w32/subproc/sub_proc.c ./w32/subproc/sub_proc.c
--- ../make.org/w32/subproc/sub_proc.c	Mon Mar 02 01:43:50 1998
+++ ./w32/subproc/sub_proc.c	Wed Aug 11 15:12:32 1999
@@ -1055,6 +1064,7 @@
 		}
 
 		while(*p) {
+                      if (enclose_in_quotes)
 			if (*p == '\"') {
 				/*
 				 * We have to insert a backslash for the "


On Wed, 25 Aug 1999 18:59:33 +0200, you wrote:

>Howdy,
>
>I think I have something that shows some promise now. The rule
>for cygwin runtime seems to be:
>
>1. Enclose the entire command line in single quotes before invoking
>   'sh -c' via CreateProcess().
>2. Escape (with a single backslash) all embedded single quotes in
>   the command line.
>3. Escape nothing else
>
>Testing with this hypothesis now and it seems to be working
>so far. Thanks to Earnie Boyd for engaging me in
>some conversation that led me to some hints on what might
>be going on under the covers. Cheers!
>
>Rob
>
>Rob Tulloh wrote:
>> 
>> Proof that cygwin is using GetCommandLine?
>> 
>> i:/apps/work/cygnus/CYGWIN~1/H-I586~1/bin/sh.exe -c 'echo \\\"hi
>> there\\\"'
>> i:/apps/work/cygnus/CYGWIN~1/H-I586~1/bin/bash.exe -c 'echo \\\"hi
>> there\\\"'
>> 
>> i:\>i:/apps/work/cygnus/CYGWIN~1/H-I586~1/bin/sh.exe -c 'echo \\\"hi
>> there\\\"'
>> 
>> \"hi there\"
>> 
>> i:\>i:/apps/work/cygnus/CYGWIN~1/H-I586~1/bin/bash.exe -c 'echo \\\"hi
>> there\\\"
>> '
>> \"hi there\"
>> 
>> There is no reason for the Microsoft runtime to grok a single quote.
>> Yet,
>> it seems to work. If you then use the normal rules for shell escapes,
>> you
>> get the desired results. Odd, but perhaps can be leveraged...
>> 
>> ROb

________________________________________________________
NetZero - We believe in a FREE Internet.  Shouldn't you?
Get your FREE Internet Access and Email at
http://www.netzero.net/download/index.html

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019