Package: hpodder
Version: 1.1.5.0+nmu2
Severity: normal

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


OK, I'm taking my first Haskell babysteps here :-)
I've attached a revised patch. It seems to work at my end. 

Cheers,
Avi


- -- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 
'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages hpodder depends on:
ii  curl                      7.21.0-1       Get a file from an HTTP, HTTPS or 
ii  id3v2                     0.1.12-2       A command line id3v2 tag editor
ii  libc6                     2.11.2-7       Embedded GNU C Library: Shared lib
ii  libffi5                   3.0.9-3        Foreign Function Interface library
ii  libgmp3c2                 2:4.3.2+dfsg-1 Multiprecision arithmetic library
ii  libsqlite3-0              3.7.3-1        SQLite 3 shared library

hpodder recommends no packages.

hpodder suggests no packages.

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkz3bKUACgkQwK8SobAxNVmJmQCfdqsNEAru0Um39O3OCSnTiKmy
cEwAnR/GGkNnww4gyOG3XSUaYTOi3XzB
=O7vB
-----END PGP SIGNATURE-----
Index: hpodder-1.1.5.0+nmu2/Download.hs
===================================================================
--- hpodder-1.1.5.0+nmu2.orig/Download.hs	2010-11-25 22:03:28.000000000 +0200
+++ hpodder-1.1.5.0+nmu2/Download.hs	2010-12-02 11:28:51.000000000 +0200
@@ -44,6 +44,9 @@
 import System.Posix.IO
 import Data.Hash.MD5
 import Control.Exception(evaluate)
+import Network.URI(escapeURIString,isUnescapedInURI)
+import List(elemIndex)
+import Data.Maybe(isNothing)
 
 data Result = Success | Failure
             deriving (Eq, Show, Read)
@@ -98,7 +101,10 @@
                 (defaultFileFlags {trunc = True})
        msgfd2 <- dup msgfd
        pid <- pOpen3Raw Nothing (Just msgfd) (Just msgfd2) 
-                 curl (curlopts ++ curlrcopts ++ [url, "-o", fp])
+                 curl (curlopts ++ curlrcopts ++ [ if isNothing ( elemIndex '%' url ) -- handle unescaped urls in feeds
+                                                   then escapeURIString isUnescapedInURI url
+                                                   else url,
+                                                   "-o", fp])
                  (return ())
        closeFd msgfd
        closeFd msgfd2

Reply via email to