[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ylwrap issues
From: |
Tim Van Holder |
Subject: |
Re: ylwrap issues |
Date: |
Fri, 15 Jun 2001 16:44:46 +0200 |
> It isn't portable.
> Could you resubmit the ylwrap patch without this?
Sure; seems like it's not needed anyway.
I must say that
sed -e 's,\\\,\\\\\\\,g'
looked like it had too many backslashes; but with just
sed -e 's,\\,\\\\,g'
sed complains about an unterminated expression.
2001-06-15 Tim Van Holder <address@hidden>
* lib/ylwrap: Improve support for DOS paths (and paths
containing backslashes in general).
Index: lib/ylwrap
===================================================================
RCS file: /cvs/automake/automake/lib/ylwrap,v
retrieving revision 1.16
diff -u -u -r1.16 lib/ylwrap
--- lib/ylwrap 2001/05/15 03:33:20 1.16
+++ lib/ylwrap 2001/06/15 14:38:02
@@ -31,8 +31,8 @@
shift
# Make any relative path in $prog absolute.
case "$prog" in
- /* | [A-Za-z]:*) ;;
- */*) prog="`pwd`/$prog" ;;
+ [\\/]* | ?:[\\/]*) ;;
+ *[\\/]*) prog="`pwd`/$prog" ;;
esac
# We also have to accept options here and append them to the program.
@@ -54,7 +54,7 @@
input="$1"
shift
case "$input" in
- /* | [A-Za-z]:*)
+ [\\/]* | ?:[\\/]*)
# Absolute path; do nothing.
;;
*)
@@ -64,10 +64,11 @@
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"
@@ -120,7 +121,7 @@
# 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