diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2001-09-02 10:28:20 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2001-09-02 10:28:20 +0200 |
commit | 0d7571054579614f9278999077921942ca08a7bf (patch) | |
tree | ea27d866c8fa82fdc2f9aecc266dcbd3d4a5dc35 /recording.c | |
parent | 4aee497101eb0546b34edfd3ccf34fe5ba140f3d (diff) | |
download | vdr-0d7571054579614f9278999077921942ca08a7bf.tar.gz vdr-0d7571054579614f9278999077921942ca08a7bf.tar.bz2 |
Using '~' in recording filename
Diffstat (limited to 'recording.c')
-rw-r--r-- | recording.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/recording.c b/recording.c index ba063fb9..c98d5252 100644 --- a/recording.c +++ b/recording.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recording.c 1.34 2001/09/01 13:05:56 kls Exp $ + * $Id: recording.c 1.35 2001/09/02 10:25:12 kls Exp $ */ #define _GNU_SOURCE @@ -179,6 +179,7 @@ void cResumeFile::Delete(void) struct tCharExchange { char a; char b; }; tCharExchange CharExchange[] = { + { '~', '/' }, { ' ', '_' }, { '\'', '\x01' }, { '/', '\x02' }, @@ -190,8 +191,16 @@ tCharExchange CharExchange[] = { char *ExchangeChars(char *s, bool ToFileSystem) { - for (struct tCharExchange *ce = CharExchange; ce->a && ce->b; ce++) - strreplace(s, ToFileSystem ? ce->a : ce->b, ToFileSystem ? ce->b : ce->a); + char *p = s; + while (*p) { + for (struct tCharExchange *ce = CharExchange; ce->a && ce->b; ce++) { + if (*p == (ToFileSystem ? ce->a : ce->b)) { + *p = ToFileSystem ? ce->b : ce->a; + break; + } + } + p++; + } return s; } |