ckolivas / lrzip

Long Range Zip
http://lrzip.kolivas.org
GNU General Public License v2.0
618 stars 76 forks source link

lrztar fails on directory names with spaces #6

Closed dvukolov closed 11 years ago

dvukolov commented 12 years ago

There seems to be an issue with how lrztar handles directory names containing spaces:

$ lrztar "a directory"
Failed to open directory.tar.lrz
No such file or directory
Fatal error - exiting

$ lrztar "one more directory"
Cannot specify output filename with more than 1 file
Fatal error - exiting

Quite peculiar :)

gotti-zz commented 12 years ago

Hi,

I think the problem is that lrzip will get something like

lrzip -o a directory
but should instead get a
lrzip -o "a directory"

One possibilty is to give in a filename with

$ lrztar -o directory.tar.lrz "a directory"
but be warned the given filename must not contain a SPACE.

Below is a patch that will hopefully solve this issue (warning untested). Be warned it will not solve the issue if you give in something like

lrztar -o "Sicherung directory.tar.lrz" "a directory"
This will still not work and currently I know no way to solve this quick and not to dirty.

Patch:

--- lrztar  2012-01-13 17:54:57.808903021 +0100
+++ lrztar.old  2012-01-13 17:54:32.044970815 +0100
@@ -64,7 +64,7 @@
         lrzcat $p "$i" | tar x
         x=$?
     } || {
-        ((v_o)) || p="$p -o \"$(basename "$s").tar.${vopt[v_S]}\""
+        ((v_o)) || p="$p -o $(basename "$s").tar.${vopt[v_S]}"
         [[ -d $s ]] || {
             printf "lrztar: directory does not exist: %s\n" "$s"
             return 1

I hope this will help you.

Gotti