Re: texpire -n -C '<Message-ID:>'

Matthias Andree <[email protected]>
Newsgroups gmane.network.leafnode
Message-ID <[email protected]>
Am 25.05.2011 01:36, schrieb Paul Brooks:
> 
> Hi All,
> 
> I've eventually started to play with texpire, can someone verify my findings please.
> 
> cat /path/msgNo
> result, it displays the message.
> Get '<Message-ID:>' from message.
> 
> -n for dry run
> texpire -n -C '<Message-ID:>'
> 
> cat /path/msgNo
> cat: /path/msgNo: No such file or directory
> 
> The message should not have been deleted as it was a dry run.

Right. Thanks for reporting this bug. The attached patch should fix it.
texpire-nC.patch (text/x-patch, 683 B)
commit f8c3b831ea2af3de9036c3dbebcff27fbfcfeec4
Author: Matthias Andree <[email protected]>
Date:   Fri May 27 01:22:44 2011 +0200

    Bugfix: don't delete articles when texpire -n -C MessID is run.
    
    Found by Paul Brooks.

diff --git a/texpire.c b/texpire.c
index 663c730..da23a29 100644
--- a/texpire.c
+++ b/texpire.c
@@ -1123,7 +1123,9 @@ main(int argc, char **argv)
 	    while(optind < argc) {
 		if (verbose)
 		    printf("Trying to remove %s...\n", argv[optind]);
-		delete_article(argv[optind], "Remove", "Removed", 1);
+		if (!dryrun) {
+		    delete_article(argv[optind], "Remove", "Removed", 1);
+		}
 		optind++;
 	    }
 	    break;
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.