3 # Stupid wrapper to avoid win32 dospath/cygdrive issues
4 # Try not to spawn programs from within this file. If the stuff in here looks royally
5 # confusing, see bug: http://bugzilla.mozilla.org/show_bug.cgi?id=206643
6 # and look at the older versions of this file that are easier to read, but
7 # do basically the same thing
12 if test -z "$prog"; then
16 # If $CYGDRIVE_MOUNT was not set in configure, give $mountpoint the results of mount -p
17 mountpoint
=$CYGDRIVE_MOUNT
18 if test -z "$mountpoint"; then
20 if test -z "$mountpoint"; then
21 print
"Cannot determine cygwin mount points. Exiting"
26 # Delete everything but "/cygdrive" (or other mountpoint) from mount=`mount -p`
27 mountpoint
=${mountpoint#*/}
28 mountpoint
=/${mountpoint%%[!A-Za-z0-9_]*}
29 mountpoint
=${mountpoint%/}
33 if test "${prog}" = "-up"; then
41 # Convert the mountpoint in parameters to Win32 filenames
42 # For instance: /cygdrive/c/foo -> c:/foo
45 if test "${i}" = "-wrap"; then
48 if test "${i}" = "-nowrap"; then
51 if test -n "${process}"; then
52 if test -n "${up}"; then
53 pathname
=${i#-I[a-zA-Z]:/}
54 if ! test "${pathname}" = "${i}"; then
56 driveletter
=${no_i%%:*}
57 i
=-I${mountpoint}/${driveletter}/${pathname}
60 eval 'leader=${i%%'${mountpoint}'/[a-zA-Z]/*}'
61 if ! test "${leader}" = "${i}"; then
62 eval 'pathname=${i#'${leader}${mountpoint}'/[a-zA-Z]/}'
63 eval 'no_mountpoint=${i#'${leader}${mountpoint}'/}'
64 driveletter
=${no_mountpoint%%/*}
65 i
=${leader}${driveletter}:/${pathname}