Change: Drop %LM from subject if Last-Modified is not found.
[usenet/yapfaq.git] / yapfaq.pl
index 2b5fe2f..5cba939 100644 (file)
--- a/yapfaq.pl
+++ b/yapfaq.pl
@@ -263,7 +263,7 @@ sub postfaq {
     s/\r//;
     push (@Body, $_), next if $InRealBody;
     $InRealBody++ if /^$/;
-    $LastModified = $1 if /^Last-modified: (\S+)$/i;
+    $LastModified = $1 if /^Last-modified:\s*(\S+)\s*$/i;
     push @Body, $_;
   }
   close FH;
@@ -292,6 +292,8 @@ sub postfaq {
   #Replace %LM by the content of the news.answer-pseudo-header Last-modified:
   if ($LastModified) {
     $$Subject =~ s/\%LM/$LastModified/;
+  } else {
+    $$Subject =~ s/[<\[{\(]?\%LM[>\]}\)]?//;
   }
 
   # Test mode?
This page took 0.010355 seconds and 4 git commands to generate.