]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Fix #1589 - only remove "unsafe" characters if configured to do so.
authorAdam Sutton <dev@adamsutton.me.uk>
Sun, 3 Feb 2013 20:10:21 +0000 (20:10 +0000)
committerAdam Sutton <dev@adamsutton.me.uk>
Sun, 3 Feb 2013 20:13:55 +0000 (20:13 +0000)
src/dvr/dvr_rec.c

index 1471ecc683ccef380483a9370949ecdc56e74937..c48eafff2a09171de3194622e2a6675ccaa0ab62 100644 (file)
@@ -126,10 +126,17 @@ cleanupfilename(char *s, int dvr_flags)
 {
   int i, len = strlen(s);
   for(i = 0; i < len; i++) { 
-    if((dvr_flags & DVR_WHITESPACE_IN_TITLE) && (s[i] == ' ' || s[i] == '\t'))
+
+    if(s[i] == '/')
+      s[i] = '-';
+
+    else if((dvr_flags & DVR_WHITESPACE_IN_TITLE) &&
+            (s[i] == ' ' || s[i] == '\t'))
       s[i] = '-';      
 
-    if((s[i] < 32) || (s[i] > 122) || (strchr("/:\\<>|*?'\"", s[i]) != NULL))
+    else if((dvr_flags & DVR_CLEAN_TITLE) &&
+            ((s[i] < 32) || (s[i] > 122) ||
+             (strchr("/:\\<>|*?'\"", s[i]) != NULL)))
       s[i] = '-';
   }
 }