summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-05-30 14:00:47 +0000
committerJim Meyering <jim@meyering.net>1997-05-30 14:00:47 +0000
commita488983890b2aaf73ff1c9fe00f36b3966206105 (patch)
treef37cf277415e0f769c61536873e46b6fb2949fb5
parent94468e0921ba91181250d650200fcecd9ee57577 (diff)
downloadcoreutils-a488983890b2aaf73ff1c9fe00f36b3966206105.tar.xz
fix for abs pathnames
-rwxr-xr-xlib/ylwrap10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/ylwrap b/lib/ylwrap
index 8aaff0f6f..f0471efb5 100755
--- a/lib/ylwrap
+++ b/lib/ylwrap
@@ -70,7 +70,13 @@ if test $status -eq 0; then
first=yes
while test "$#" -ne 0; do
if test -f "$1"; then
- mv "$1" "../$2" || status=$?
+ # If $2 is an absolute path name, then just use that,
+ # otherwise prepend `../'.
+ case "$2" in
+ /*) target="$2";;
+ *) target="../$2";;
+ esac
+ mv "$1" "$target" || status=$?
else
# A missing file is only an error for the first file. This
# is a blatant hack to let us support using "yacc -d". If -d
@@ -90,6 +96,6 @@ fi
# Remove the directory.
cd ..
-rm -rf $dirname
+#rm -rf $dirname
exit $status