From: Richard W.M. Jones <"Richard W.M. Jones "> Date: Wed, 30 Apr 2008 13:30:20 +0000 (+0100) Subject: Fix case where binary name doesn't have any extension. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=e2895899d12b62600d3fe861e206e7538d159d29;p=virt-df.git Fix case where binary name doesn't have any extension. --- diff --git a/diskzip/diskzip.ml b/diskzip/diskzip.ml index b4a0a5a..21d2cc3 100644 --- a/diskzip/diskzip.ml +++ b/diskzip/diskzip.ml @@ -29,8 +29,10 @@ let rec main () = (* Program name changes behaviour. *) let compressing = let name = Sys.argv.(0) in - let name = Filename.basename name in (* just the executable name *) - let name = Filename.chop_extension name in (* remove .opt or .exe *) + let name = Filename.basename name in (* just the executable name *) + let name = (* remove .opt or .exe *) + try Filename.chop_extension name + with Invalid_argument("Filename.chop_extension") -> name in let name = String.lowercase name in match name with | "diskzcat" -> false @@ -145,6 +147,11 @@ and go_compress extcompress images = (* Scan the images for filesystems. *) let machine = Diskimage.scan_machine machine in + (* Create ownership tables. *) + let ownership = Diskimage.create_ownership machine in + + + (* Redirect output through external pipe if asked. *) (match extcompress with | None -> ()