~ubuntu-desktop/rhythmbox/ubuntu

« back to all changes in this revision

Viewing changes to debian/patches/02_use_escaped_podcast_uri.patch

  • Committer: Iain Lane
  • Date: 2018-07-24 16:02:34 UTC
  • Revision ID: iain@orangesquash.org.uk-20180724160234-54a1vhulj1p11m1d
Moved to git: lp:~ubuntu-desktop/ubuntu/+source/rhythmbox

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
=== modified file 'podcast/rb-podcast-manager.c'
2
 
Index: rhythmbox-2.97/podcast/rb-podcast-manager.c
3
 
===================================================================
4
 
--- rhythmbox-2.97.orig/podcast/rb-podcast-manager.c    2012-06-04 10:24:44.591435382 +0100
5
 
+++ rhythmbox-2.97/podcast/rb-podcast-manager.c 2012-06-04 10:24:55.207434915 +0100
6
 
@@ -29,6 +29,7 @@
7
 
 #include "config.h"
8
 
 
9
 
 #include <string.h>
10
 
+#include <ctype.h>
11
 
 #define __USE_XOPEN
12
 
 #include <time.h>
13
 
 
14
 
@@ -859,9 +860,15 @@
15
 
        }
16
 
 
17
 
        if (local_file_name == NULL) {
18
 
-               /* fall back to the basename from the original URI */
19
 
-               local_file_name = g_file_get_basename (data->source);
20
 
-               rb_debug ("didn't get a filename from the file info request; using basename %s", local_file_name);
21
 
+               char *c;
22
 
+
23
 
+               /* fall back to the escaped URI */
24
 
+               local_file_name = g_file_get_uri (data->source);
25
 
+               for (c = local_file_name; *c; c++) {
26
 
+                       if (!isalnum (*c) && *c != '.')
27
 
+                               *c = '-';
28
 
+               }
29
 
+               rb_debug ("didn't get a filename from the file info request; using escaped uri %s", local_file_name);
30
 
        }
31
 
 
32
 
        /* if the filename ends with the query string from the original URI,