Merge branch 'master' of feistymeow.org:feisty_meow
[feisty_meow.git] / scripts / files / filedump.pl
index 3fa5b0f30e73b4e770feb456b29a9d8aac792361..de91299c081ccff7770a8254a10eb1c689131f4f 100644 (file)
@@ -68,10 +68,14 @@ sub do_dump {
   $shorter_name =~ s/\.txt$//;
   $shorter_name =~ s/_/ /g;
 
-  $dashed_line = $shorter_name;
-  $dashed_line =~ s/./-/g;
-
-  $header_copy =~ s/%1/$shorter_name/;
+  # we're using the extra equals in front as an almost uniquifier for the
+  # header lines.  we then can treat any matching line as a header, although
+  # some input files could trick this heuristic.
+  $munged_name = "= $shorter_name";
+  $dashed_line = $munged_name;
+  $dashed_line =~ s/./=/g;
+
+  $header_copy =~ s/%1/$munged_name/;
   $header_copy =~ s/%2/$dashed_line/g;
 
 ##print $header_copy;