You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by qu...@apache.org on 2004/02/18 08:12:02 UTC

svn commit: rev 6718 - incubator/spamassassin/trunk/masses

Author: quinlan
Date: Tue Feb 17 23:12:02 2004
New Revision: 6718

Modified:
   incubator/spamassassin/trunk/masses/mboxget
Log:
tweak to guess whether getting a file or a file.offset
(maybe this behavior should have a flag?)


Modified: incubator/spamassassin/trunk/masses/mboxget
==============================================================================
--- incubator/spamassassin/trunk/masses/mboxget	(original)
+++ incubator/spamassassin/trunk/masses/mboxget	Tue Feb 17 23:12:02 2004
@@ -26,9 +26,11 @@
 $prog =~ s@.*/@@;
 
 foreach my $where (@ARGV) {
-  my ($file, $offset) = ($where =~ m/(.*)\.(\d+)$/);
+  my ($file, $offset) = ($where =~ m/(.*?)(?:\.(\d+))?$/);
   open(INPUT, $file) || die("$prog: open $file failed: $!\n");
-  seek(INPUT, $offset, 0) || die("$prog: seek $offset failed: $!\n");
+  if ($offset) {
+    seek(INPUT, $offset, 0) || die("$prog: seek $offset failed: $!\n");
+  }
   my $past = 0;
   while (<INPUT>) {
     if ($past) {