cygpath -m behaviour change

David Griffiths david.griffiths@gmail.com
Thu Sep 19 14:36:00 GMT 2013


> 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



More information about the Cygwin mailing list