delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/01/03/16:03:16

X-Spam-Check-By: sourceware.org
Message-ID: <20060103210307.63140.qmail@web53410.mail.yahoo.com>
Date: Tue, 3 Jan 2006 13:03:07 -0800 (PST)
From: Dave <d_inabox AT yahoo DOT com>
Subject: Re: chere problem with directories with single quote marks
To: cygwin AT cygwin DOT com
Cc: tomas AT fancy DOT org
MIME-Version: 1.0
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

Eric said:
>According to Tom Plunket on 12/23/2005 11:48 PM:
>> 
>>        SHELL_CMD="-l -c \\\"cd '%L'; exec $SHELL_EXE\\\""
>> 
>> As you can see, this is clearly "wrong" for folders with a
>> single-quote mark in them.
>> 
>> My local fix was just to edit the registry and change '%L' to "%L".
>> Obviously this affects the handling of this feature with folders that
>> have a double-quote mark in them, but as I only use single quotes
>> (e.g. "Debbie's Truck" or "Craig's List"), it Works For Me.  ;)
>
> Window's allows ' but not " in filenames.  However, Windows also allows $
> in filenames, so switching to double quotes would trade the problems with
> ' to problems with $.  And you need quoting, or spacing would be
> corrupted.  Off the top of my head, I can only think of one way that might
> preserve ', $, and spaces in the problematic %L when dumped literally into
> a shell script, but I don't know if Windows SHELL_CMD can handle embedded
> newlines.  In a normal shell window,
>
> $ xargs -0 << 'EOF'
> > a  '$b
> > EOF
> a  '$b
>
> the here-doc correctly preserved the input string.  So applying that to
> the above problem, the registry entry MIGHT work (untested by me) if it is
> written as:
>
> SHELL_CMD="-l -c \\\"xargs -0 cd << 'EOF'\n%L\nEOF\nexec $SHELL_EXE\\\""

Hmmm. It appears that I haven't handled this case consistently. I'll have a look
at getting both ' and $ to work properly.

Thanks for the report.

Dave.
chere maintainer

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


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