This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: cygpath -m behaviour change
- From: David Griffiths <david dot griffiths at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 19 Sep 2013 14:23:22 +0100
- Subject: Re: cygpath -m behaviour change
- Authentication-results: sourceware.org; auth=none
> 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