delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/01/20/05:06:05

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Date: Thu, 20 Jan 2005 11:05:36 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: cygwin programs called from non-cygwin programs mauling \" in args
Message-ID: <20050120100536.GA5809@cygbert.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20050113064248 DOT GA2416 AT efn DOT org> <20050119233410 DOT GA2888 AT efn DOT org> <20050120092613 DOT GB4951 AT cygbert DOT vinschen DOT de> <20050120094141 DOT GA3508 AT efn DOT org>
Mime-Version: 1.0
In-Reply-To: <20050120094141.GA3508@efn.org>
User-Agent: Mutt/1.4.2i

On Jan 20 01:41, Yitzchak Scott-Thoennes wrote:
> On Thu, Jan 20, 2005 at 10:26:13AM +0100, Corinna Vinschen wrote:
> > Yitzchak,
> > 
> > On Jan 19 15:34, Yitzchak Scott-Thoennes wrote:
> > > > $ ./nocygparent cygchild
> > > > [a\b"c]
> > > 
> > > Can anybody else confirm this?
> > 
> > I can.  I already had a look into this.
> 
> Wonderful!  Thanks a lot!
> 
> > The command line handling in
> > Cygwin is different from the command line handling in MingW or, FWIW,
> > VC++ CLI applications.
> > 
> > The question is if we really should align the rules how a native
> > command line is evaluated by a Cygwin process should be aligned
> > to Windows rules or not.
> 
> I'd be happy with \" coming out either as " or as \".  But just \ is just
> a little too weird for me (aside from the trouble it's causing me).

Ok, just to explain what happens right now:

The evaluation algorithm allows two different types of quoting, using
single (') or double (") quotes.  Backslashes are not treated as
escape characters outside of quotes.  So what happens is that the
first backslash is treated as backslash (path separator from the
native perspective, then a double quote quoting starts, the next
backslash is treated as escape for the following double quote, only
leaving the double quote.  Since there's no further double quote, the
quoting stops at the end of the string.

Compared with Windows native rules:

The evaluation algorithm allows only double quotes as quoting character.
Backslashes only escape quotes.  Any number of backslashes is treated
literally, unless followed by a double quote.  In that case, each pair
of backslashes is treated as one backslash and a remaining \" is treated
as escaped double quote character.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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