From 0a6d7c39fc94e4368e9f5777d1dfba0086ae57c5 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 1 Jul 2001 23:46:00 +0000 Subject: [PATCH] 2001-07-01 Tim Van Holder * lib/ylwrap: Improve support for DOS paths (and paths containing backslashes in general). --- ChangeLog | 5 +++++ lib/ylwrap | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5a4b133c..5ee02b23 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-07-01 Tim Van Holder + + * lib/ylwrap: Improve support for DOS paths (and paths + containing backslashes in general). + 2001-07-01 Tom Tromey * lib/missing: Added special exception to license. diff --git a/lib/ylwrap b/lib/ylwrap index f87c55eb..d9e07bca 100755 --- a/lib/ylwrap +++ b/lib/ylwrap @@ -30,7 +30,7 @@ input="$1" shift case "$input" in - /* | [A-Za-z]:*) + [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) @@ -40,10 +40,10 @@ case "$input" in esac # The directory holding the input. -input_dir="`echo $input | sed -e 's,/[^/]*$,,'`" +input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` # Quote $INPUT_DIR so we can use it in a regexp. -# FIXME: really we should care about more than `.'. -input_rx="`echo $input_dir | sed -e 's,\.,\\\.,g'`" +# FIXME: really we should care about more than `.' and `\'. +input_rx=`echo "$input_dir" | sed -e 's,\\\\,\\\\\\\\,g' -e 's,\\.,\\\\.,g'` echo "got $input_rx" @@ -62,8 +62,8 @@ prog="$1" shift # Make any relative path in $prog absolute. case "$prog" in - /* | [A-Za-z]:*) ;; - */*) prog="`pwd`/$prog" ;; + [\\/]* | ?:[\\/]*) ;; + *[\\/]*) prog="`pwd`/$prog" ;; esac # FIXME: add hostname here for parallel makes that run commands on @@ -105,7 +105,7 @@ if test $status -eq 0; then # If $2 is an absolute path name, then just use that, # otherwise prepend `../'. case "$2" in - /* | [A-Za-z]:*) target="$2";; + [\\/]* | ?:[\\/]*) target="$2";; *) target="../$2";; esac -- 2.43.5