]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cd2nroff: fix duplicate output issue
authorDaniel Stenberg <daniel@haxx.se>
Mon, 29 Jan 2024 21:39:33 +0000 (22:39 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 30 Jan 2024 07:24:32 +0000 (08:24 +0100)
Assisted-by: Jay Satiro
Fixes https://github.com/curl/curl-www/issues/321
Closes #12818

scripts/cd2nroff

index bbc7969a395621a1bd496375de2bebb53803df03..e8c8235dd2d8eef11615585dbba3a76ecce816ff 100755 (executable)
@@ -337,14 +337,12 @@ sub single {
     return $errors;
 }
 
-$f = $ARGV[0];
-if(defined($f)) {
-    while($f) {
-        $r = single($f);
+if(@ARGV) {
+    for my $f (@ARGV) {
+        my $r = single($f);
         if($r) {
             exit $r;
         }
-        $f = shift @ARGV;
     }
 }
 else {