delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/11/20/15:06:41

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Mon, 20 Nov 2000 21:22:39 +0100
From: Pierre Bogossian <bogus AT bsdshell DOT net>
To: cygwin AT cygwin DOT com
Subject: Re: [PATCH] Fix for backslash quoting in argument list passing (spawn_guts)
Message-ID: <20001120212239.A79433@free.bsdshell.net>
Mime-Version: 1.0
User-Agent: Mutt/1.2.5i

>I've included what I think is a much simpler patch below.  It seems to
>work correctly using a vc compiled program which echos its args.

The problem with your patch is that it can double backslashes even if
they don't precede a '"', and that shouldn't be done !
Here is what I get with your patch:

/tmp $ ./print_args_cygwin.exe 'a a\\a'
1: a a\\a
/tmp $ ./print_args_nocygwin.exe 'a a\\a'
1: a a\\\\a

Another issue is that backslashes that are just before the closing '"'
have to be doubled too:

/tmp $ ./print_args_cygwin.exe 'a a\'
1: a a\
/tmp $ ./print_args_nocygwin.exe 'a a\'
1: a a"

My print_args_nocygwin.exe is compiled with gcc, but I guess the
result is the same with vc.

Pierre Bogossian

--
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