Adam Dinwoodie | 26 Nov 11:44 2012

"MS-DOS style path detected" triggered by escaped $ in path

Hi,

If I use paths that contain $ symbols, and backslash-escape them, I start
seeing warnings about MS-DOS style paths in Cygwin bash.  For example, where I
hit <tab> after the .ssh/:

    $ cp //pcname/C\$/cygwin/home/add/.ssh/cygwin warning:
      MS-DOS style path detected: //pcname/C\$/cygwin/home/add/.ssh/
      Preferred POSIX equivalent is: //pcname/C/$/cygwin/home/add/.ssh/
      CYGWIN environment variable option "nodosfilewarning" turns off this warning.
      Consult the user's guide for more details about POSIX paths:
        http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

I believe the path I entered, //pcname/C\$/cygwin/home/add/.ssh/, is valid.
The equivalent MS-DOS style path would be \\pcname\C$\cygwin\home\add\.ssh\.

This appears to simply be an erroneous warning; everything else I tried works,
including tab-completion, calls to cp or ls or similar.  Leaving out the
backslash-escape works, but only thanks to the particulars of bash's handling
of $ and the next character being /.  Single-quoting the path also avoids the
warning, but prevents tab-completion.  Partial quoting (ie //pcname/C'$'/cygwin/)
has the '$' replaced by (the apparently erroneous) \$ when I attempt to use
tab-completion!

The only impact I can see is the "MS-DOS style path" warning, and I'm aware
this is an edge case, so I'm not going to get excited about getting this fixed.
I just figured I'd report a bug when I spotted one.

(Thinking about it, I'm not sure it even is a bug; I could have been intending
to talk about \\pcname\C\$ rather than \\pcname\C$.  I suspect this may be
(Continue reading)

Corinna Vinschen | 27 Nov 08:42 2012

Re: "MS-DOS style path detected" triggered by escaped $ in path

On Nov 26 10:44, Adam Dinwoodie wrote:
> Hi,
> 
> If I use paths that contain $ symbols, and backslash-escape them, I start
> seeing warnings about MS-DOS style paths in Cygwin bash.  For example, where I
> hit <tab> after the .ssh/:
> 
>     $ cp //pcname/C\$/cygwin/home/add/.ssh/cygwin warning:
>       MS-DOS style path detected: //pcname/C\$/cygwin/home/add/.ssh/
>       Preferred POSIX equivalent is: //pcname/C/$/cygwin/home/add/.ssh/
>       CYGWIN environment variable option "nodosfilewarning" turns off this warning.
>       Consult the user's guide for more details about POSIX paths:
>         http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
> 
> I believe the path I entered, //pcname/C\$/cygwin/home/add/.ssh/, is valid.
> The equivalent MS-DOS style path would be \\pcname\C$\cygwin\home\add\.ssh\.
> 
> This appears to simply be an erroneous warning; everything else I tried works,
> including tab-completion, calls to cp or ls or similar.

This is a bash problem, apparently.  In tcsh you'll never see this.  The
above message is printed by Cygwin's path handling.  That means, bash
has given the path to some POSIX function *with* the backslash included.

Evaluating escape sequences is not the job of the system functions, but
of the caller, so I'd expect that the path gets de-escaped by bash
before calling the system function, but that's apparently not the case.

Corinna

(Continue reading)

Adam Dinwoodie | 27 Nov 11:09 2012

RE: "MS-DOS style path detected" triggered by escaped $ in path

Corinna Vinschen wrote:
> On Nov 26 10:44, Adam Dinwoodie wrote:
>> If I use paths that contain $ symbols, and backslash-escape them, I start
>> seeing warnings about MS-DOS style paths in Cygwin bash.  For example, where I
>> hit <tab> after the .ssh/:
>>
>>     $ cp //pcname/C\$/cygwin/home/add/.ssh/cygwin warning:
>>       MS-DOS style path detected: //pcname/C\$/cygwin/home/add/.ssh/
>>       Preferred POSIX equivalent is: //pcname/C/$/cygwin/home/add/.ssh/
>>       CYGWIN environment variable option "nodosfilewarning" turns off this warning.
>>       Consult the user's guide for more details about POSIX paths:
>>         http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

>>
>> I believe the path I entered, //pcname/C\$/cygwin/home/add/.ssh/, is valid.
>> The equivalent MS-DOS style path would be \\pcname\C$\cygwin\home\add\.ssh\.
>>
>> This appears to simply be an erroneous warning; everything else I tried works,
>> including tab-completion, calls to cp or ls or similar.
>
> This is a bash problem, apparently.  In tcsh you'll never see this.  The
> above message is printed by Cygwin's path handling.  That means, bash
> has given the path to some POSIX function *with* the backslash included.
>
> Evaluating escape sequences is not the job of the system functions, but
> of the caller, so I'd expect that the path gets de-escaped by bash
> before calling the system function, but that's apparently not the case.

How odd.  As you say, I wouldn't expect bash to be passing the unescaped string
to any Cygwin/POSIX function.

(Continue reading)


Gmane