From e2895899d12b62600d3fe861e206e7538d159d29 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] Fix case where binary name doesn't have any extension. --- diskzip/diskzip.ml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 -> () -- 1.8.3.1