~ubuntu-branches/ubuntu/saucy/checkbot/saucy-proposed

« back to all changes in this revision

Viewing changes to debian/patches/01decoded_content_fallback.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Ralf Treinen
  • Date: 2009-03-27 21:38:40 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090327213840-ruvhzz3rise39vce
Tags: 1.80-1
* New upstream release
* Removed patch 01decoded_content_fallback since this is now in
  upsream.
* Standards-Version 3.8.1 (no change)
* debian/copyright: Put into a more standard format, remove some cruft.
* Debhelper-compatibility level 5, increment build-dependency on debhelper
  accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh /usr/share/dpatch/dpatch-run
2
 
## 01decoded_content_fallback.dpatch by Ralf Treinen <treinen@debian.org>
3
 
##
4
 
## DP: fallback for decoded_content when charset information is missing
5
 
## DP: Taken from the upstream svn repo, r234.
6
 
## DP: This patch should be obsolete for upstream version > 1.79
7
 
 
8
 
@DPATCH@
9
 
diff -urNad checkbot-1.79~/checkbot checkbot-1.79/checkbot
10
 
--- checkbot-1.79~/checkbot     2007-02-03 17:05:53.000000000 +0100
11
 
+++ checkbot-1.79/checkbot      2007-02-26 23:12:08.000000000 +0100
12
 
@@ -1177,7 +1177,12 @@
13
 
   # in the response, otherwise we won't get the same behavior as
14
 
   # browsers and miss things like a BASE url in pages.
15
 
   my $p = HTML::LinkExtor->new(undef, $response->base);
16
 
-  $p->parse($response->decoded_content);
17
 
+
18
 
+  # If charset information is missing then decoded_content doesn't
19
 
+  # work. Fall back to content in this case, even though that may lead
20
 
+  # to charset warnings. See bug 1665075 for reference.
21
 
+  my $content = $response->decoded_content || $response->content;
22
 
+  $p->parse($content);
23
 
   $p->eof;
24
 
 
25
 
   # Deal with the links we found in this document