public inbox for gnats-devel@sourceware.org
 help / color / mirror / Atom feed
From: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
To: <gnats-devel@sources.redhat.com>
Cc: Tommi Virtanen <tv@debian.org>
Subject: Re: Bug#65754: gnatsweb breaks on file attachements (fwd)
Date: Thu, 15 Mar 2001 14:40:00 -0000	[thread overview]
Message-ID: <Pine.BSF.4.33.0103152337580.37021-100000@deneb.dbai.tuwien.ac.at> (raw)

I just installed the following patch by Tommi, which is based on a PR
from the Debian bug tracking system. (Tommi, in case you wonder I made
the ChangeLog entry conform a bit close to the GNU Coding Standards.)

Thanks!

Gerald

2001-03-11  Tommi Virtanen  <tv@debian.org>

        * gnatsweb.pl (decode_attachment): Editing bugs with attached files
        used to bomb out trying to chomp a constant string.

diff -Naur gnats-3.113.orig/contrib/gnatsweb/gnatsweb.pl gnats-3.113/contrib/gnatsweb/gnatsweb.pl
--- gnats-3.113.orig/contrib/gnatsweb/gnatsweb.pl	Thu Oct 28 16:57:01 1999
+++ gnats-3.113/contrib/gnatsweb/gnatsweb.pl	Sun Mar 11 12:40:59 2001
@@ -473,14 +473,15 @@
   my ($envelope, $body) = split(/\n\n/, $att);
   return $hash_ref unless ($envelope && $body);

-  # Got the idea from this from the perldoc for split.
-  # The extra map step is the only way I could think of to strip
-  # the trailing newlines from the hash values.
+  # Split mbox-like headers into (header, value) pairs, with a leading
+  # "From_" line swallowed into USELESS_LEADING_ENTRY. Junk the leading
+  # entry. Chomp all values.
   warn "decode_attachment: envelope=>$envelope<=\n" if $debug;
-  #%$hash_ref = (USELESS_LEADING_ENTRY => split /^(\S*?):\s*/m, $envelope);
-  %$hash_ref = (map {chomp; $_;}
-               (USELESS_LEADING_ENTRY => split /^(\S*?):\s*/m, $envelope));
-  delete($$hash_ref{USELESS_LEADING_ENTRY});
+  %$hash_ref = (USELESS_LEADING_ENTRY => split /^(\S*?):\s*/m, $envelope);
+  delete($hash_ref->{USELESS_LEADING_ENTRY});
+  for (keys %$hash_ref) {
+    chomp $hash_ref->{$_};
+  }

   # Keep the original_attachment intact.
   $$hash_ref{'original_attachment'} = $att;

                 reply	other threads:[~2001-03-15 14:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.BSF.4.33.0103152337580.37021-100000@deneb.dbai.tuwien.ac.at \
    --to=pfeifer@dbai.tuwien.ac.at \
    --cc=gnats-devel@sources.redhat.com \
    --cc=tv@debian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).