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]

cygpath output unnecessary ending slash/

When specify --windows or --mixed form, cygpath will append `/' to the result path when it is a directory, this is unnecessary and inconformity, for example:

cygpath -u some/dir
    > some/dir
cygpath -m some/dir
    > some/dir/
cygpath -w .
    > x:\some\dir\

The ending `\' is only needed when the win32 path points to the drive root, for example /cygdrive/c => C:\, and even this is not a must, because in most cases the path will join another path segment `cygpath -w /cygdrive/c`/path/segment and the slash after the drive letter is duplicated.

A severe problem with the ending back-slash \ is it will cause to escape the following quote (", ') character,

    if [ "$cygwin" = "true" ] ; then
      PROJECT_HOME=`cygpath -w "$PWD"`

# do with "$PROJECT_HOME" ...

The PROJECT_HOME looks like "T:\TEMP\" and it cause the following statement can't be parsed correctly:
# do with "T:\TEMP\" ...
the \" is escaped, then

/mnt/t/apache-forrest-0.8/tools/ant/bin/ant: eval: line 301: unexpected EOF while looking for matching `"'
/mnt/t/apache-forrest-0.8/tools/ant/bin/ant: eval: line 302: syntax error: unexpected end of file

Problem reports:
Unsubscribe info:

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