This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cygpath -m behaviour change


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]