Don't modify headers while --testing if -o is set.

Signed-off-by: Thomas Hochstein <thh@thh.name>
This commit is contained in:
Thomas Hochstein 2026-01-24 18:25:31 +01:00
parent 9177618643
commit 6b73bdfdd3
2 changed files with 5 additions and 5 deletions

View file

@ -1,5 +1,5 @@
yapfaq 1.1.0 (unreleased) yapfaq 1.1.0 (unreleased)
* --test: Set Supersedes and don't modify Message-ID if -o is set.
yapfaq 1.0.1 (2025-01-24) yapfaq 1.0.1 (2025-01-24)
* Add %t placeholder for Message-ID (feature parity with 0.9). * Add %t placeholder for Message-ID (feature parity with 0.9).

View file

@ -475,7 +475,7 @@ sub BuildPosting {
$_ =~ s/\%p/$$/g; $_ =~ s/\%p/$$/g;
$_ =~ s/\%t/$TimeStamp/g; $_ =~ s/\%t/$TimeStamp/g;
# add random part in test mode # add random part in test mode
if ($OptTest) { if ($OptTest && !$OptOutput) {
my $random = sprintf("%08X", rand(0xFFFFFFFF)); my $random = sprintf("%08X", rand(0xFFFFFFFF));
$_ =~ s/</<test-$random-/; $_ =~ s/</<test-$random-/;
} }
@ -491,7 +491,7 @@ sub BuildPosting {
} }
# add Supersedes: if set # add Supersedes: if set
if (/^Supersedes: /) { if (/^Supersedes: /) {
if ($LastMID && !$OptTest) { if ($LastMID && (!$OptTest or $OptOutput)) {
$_= "Supersedes: $LastMID\n"; $_= "Supersedes: $LastMID\n";
} else { } else {
$_ = ''; $_ = '';
@ -868,8 +868,8 @@ Can be combined with B<--project> to show if just one project is due.
=item B<-t>, B<--test> =item B<-t>, B<--test>
Test mode. Don't update project status (time and Message-ID of last Test mode. Don't update project status (time and Message-ID of last
posting), dont' add a I<Supersedes:> header and modify the posting); if project is posted to Usenet, dont' add a I<Supersedes:>
I<Message-ID:> with a random part. header and modify the I<Message-ID:> with a random part.
The text(s) will still be posted if due or forced by B<--force>. The text(s) will still be posted if due or forced by B<--force>.