delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/09/19/09:23:52

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:date:message-id:subject:from:to
:content-type; q=dns; s=default; b=K+vC+QnfjCGv6BEe6ZxpfoFrMmhfB
mii8GdN2r4Wgz8LbApRYg6w8yOehaZaBMi2R5wZdpp2Ni99J0cBMoWOYxsXIcR6I
I7iv0JzzakKf0GHU/8wuKVd+09ipwJq9R3m3I0NWOrrE9A3jqiHOYjzLDmF6nwP0
1mN20g+prAv7kc=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:date:message-id:subject:from:to
:content-type; s=default; bh=ZmpxZWUWC334sqUi5U/rphxjXa0=; b=XvV
7JU5id542xALVETUBqqdycnErQZn4gqwVtE24rioaFmEJ8hBQefehy0Qt8pqYYXI
Br8LxXMf2127q1fS3jghDgYhkFdyJ5Vov3r3USmFSbDIcMu0ai0ue8Ykm3/zYAj5
XoDFkLUBjoxJl1rqnk0EczjFGjGMMWvzoQ32sWhU=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,NO_RELAYS autolearn=ham version=3.3.2
X-HELO: mail-ie0-f171.google.com
MIME-Version: 1.0
X-Received: by 10.50.23.16 with SMTP id i16mr1108961igf.50.1379597002736; Thu, 19 Sep 2013 06:23:22 -0700 (PDT)
Date: Thu, 19 Sep 2013 14:23:22 +0100
Message-ID: <CAF+hkWrUP9UuovH19rgocb4+37Q5V8-LPxNLwi+qUYc4qDm5zg@mail.gmail.com>
Subject: Re: cygpath -m behaviour change
From: David Griffiths <david DOT griffiths AT gmail DOT com>
To: cygwin AT cygwin DOT com

> But why are you even using cygpath to try and determine the containing
> directory?  'dirname' does that task, in a much more portable manner,
> and without having to worry about whether 'file/..' can be abused in
> spite of POSIX semantics

To given even more context, this is how it was used:

uname=`uname`

case $uname in
  CYGWIN_*)
    CURRENT_DIR=$(cygpath -ma "${0}\..")
    ;;

  *)
    CURRENT_DIR=$(cd $(dirname "$0") && pwd)
esac

CURRENT_DIR (or something derived from it) ends up getting passed to a
Java program which requires the absolute pathname in native format.
The dirname/pwd variant won't do that under cygwin.

Cheers,

Dave

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