delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/06/23/10:13:43

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Thu, 23 Jun 2011 16:12:53 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Strange cygpath behavior.
Message-ID: <20110623141253.GA20806@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <73619422 DOT 20110621092310 AT mtu-net DOT ru>
MIME-Version: 1.0
In-Reply-To: <73619422.20110621092310@mtu-net.ru>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
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

On Jun 21 09:23, Andrey Repin wrote:
> Greetings, All!
> 
> I'm facing an unacceptable cygpath behavior related to the network shares.
> 
> The testcase is:

Here's what happens on my machine:

> [\\DAEMON1\anrdaemon]$cygpath -u \\DAEMON1\anrdaemon\.profile
> //DAEMON1/anrdaemon/.profile

  /cygdrive/c/DAEMON1anrdaemon.profile

> [\\DAEMON1\anrdaemon]$cygpath -m \\DAEMON1\anrdaemon\.profile
> //DAEMON1/anrdaemon/.profile

  C:/DAEMON1anrdaemon.profile

> [\\DAEMON1\anrdaemon]$cygpath -lm \\DAEMON1\anrdaemon\.profile
> //DAEMON1/anrdaemon/.profile

  C:/DAEMON1anrdaemon.profile

> [\\DAEMON1\anrdaemon]$cygpath -u "\\DAEMON1\anrdaemon\.profile"
> /DAEMON1/anrdaemon/.profile

  /cygdrive/c/DAEMON1/anrdaemon/.profile

> 
> [\\DAEMON1\anrdaemon]$cygpath -m "\\DAEMON1\anrdaemon\.profile"
> ///DAEMON1/anrdaemon/.profile

  C:/DAEMON1/anrdaemon/.profile

> 
> [\\DAEMON1\anrdaemon]$cygpath -lm "\\DAEMON1\anrdaemon\.profile"
> ///DAEMON1/anrdaemon/.profile

  C:/DAEMON1/anrdaemon/.profile

Alternatively:

  $ cygpath -u '\\DAEMON1\anrdaemon\.profile'
  //DAEMON1/anrdaemon/.profile

  $ cygpath -m '\\DAEMON1\anrdaemon\.profile'
  //DAEMON1/anrdaemon/.profile

  $ cygpath -lm '\\DAEMON1\anrdaemon\.profile'
  //DAEMON1/anrdaemon/.profile

> Only unquoted path producing usable results, but it's not realistically
> imaginable I would let it run this way.

There's something weird in your bash settings.  Usually bash will fold the
backslashes before using the string as argument to the child process.  See
the behaviour with echo:

  $ echo \a
  a
  $ echo \\a
  \a
  $ echo "\a"
  \a
  $ echo "\\a"
  \a
  $ echo '\a'
  \a
  $ echo '\\a'
  \\a

So what cygpath gets as argument in your first example is usually

  \DAEMON1anrdaemon.profile

I don't know what the difference in your settings is, though.  Something
with readline, maybe.


Corinna

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

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

- Raw text -


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