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

Denys Vlasenko <vda.linux-gM/[email protected]>
Newsgroups gmane.comp.gnome.apps.mc.devel
Message-ID <CAK1hOcNt9iQ4xCe0CyHUYus5VgSr48TczbNw7nmH9OV3GhTYiQ@mail.gmail.com>
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
 }'
 }
_______________________________________________
mc-devel mailing list
https://mail.gnome.org/mailman/listinfo/mc-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.