[PATCH] isofs fix: do not skip all .dotfiles

There appears to be an easy bug in iso9660 helper:

if (name ~ /^\.\.?/) next

means "skip all lines which start with one or two dots".
Author probably meant: if (name ~ /^\.\.?$/) next

I propose to not be cryptic and just check both possibilities separately.

The below trivial patch was tested to work: now I see
the file named ".dot" in a test iso file.

(Note: there seems to be another bug: SEMICOLON = "YES"
is not a correct comparison (should use ==),
it's assignment! As a result, sub(";1$", "", name);
is always executed).

--- a/src/vfs/extfs/helpers/iso9660.in
+++ b/src/vfs/extfs/helpers/iso9660.in
@@ -156,7 +156,8 @@ BEGIN {
   if (SEMICOLON = "YES") sub(";1$", "", name);
   ## sub(";[0-9]+$", "", name) ## would break copyout
   # skip . and ..
-  if (name ~ /^\.\.?/) next;
+  if (name == ".") next;
+  if (name == "..") next;
   printf "%s%s%s\n", attr, dir, name

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]