2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 # Stupid wrapper to avoid win32 dospath/cygdrive issues
8 # Try not to spawn programs from within this file. If the stuff in here looks royally
9 # confusing, see bug: http://bugzilla.mozilla.org/show_bug.cgi?id=206643
10 # and look at the older versions of this file that are easier to read, but
11 # do basically the same thing
16 if test -z "$prog"; then
20 # If $CYGDRIVE_MOUNT was not set in configure, give $mountpoint the results of mount -p
21 mountpoint
=$CYGDRIVE_MOUNT
22 if test -z "$mountpoint"; then
24 if test -z "$mountpoint"; then
25 print
"Cannot determine cygwin mount points. Exiting"
30 # Delete everything but "/cygdrive" (or other mountpoint) from mount=`mount -p`
31 mountpoint
=${mountpoint#*/}
32 mountpoint
=/${mountpoint%%[!A-Za-z0-9_]*}
33 mountpoint
=${mountpoint%/}
37 if test "${prog}" = "-up"; then
45 # Convert the mountpoint in parameters to Win32 filenames
46 # For instance: /cygdrive/c/foo -> c:/foo
49 if test "${i}" = "-wrap"; then
52 if test "${i}" = "-nowrap"; then
55 if test -n "${process}"; then
56 if test -n "${up}"; then
57 pathname
=${i#-I[a-zA-Z]:/}
58 if ! test "${pathname}" = "${i}"; then
60 driveletter
=${no_i%%:*}
61 i
=-I${mountpoint}/${driveletter}/${pathname}
64 eval 'leader=${i%%'${mountpoint}'/[a-zA-Z]/*}'
65 if ! test "${leader}" = "${i}"; then
66 eval 'pathname=${i#'${leader}${mountpoint}'/[a-zA-Z]/}'
67 eval 'no_mountpoint=${i#'${leader}${mountpoint}'/}'
68 driveletter
=${no_mountpoint%%/*}
69 i
=${leader}${driveletter}:/${pathname}