summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2013-05-14 16:42:49 +0200
committerportix <portix@gmx.net>2013-05-14 16:42:49 +0200
commitb0efd96352f031eef5c031cb601fb8594f7d3e7e (patch)
tree8bf24601791551f388b6cc6b7428a0f161395a76
parent3181021b8f0a069a3b18731ae0557ccc8d916741 (diff)
downloaddwb-b0efd96352f031eef5c031cb601fb8594f7d3e7e.zip
Replace hash-signs in download paths
-rw-r--r--src/util.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c
index 696c2e0d..c84319f2 100644
--- a/src/util.c
+++ b/src/util.c
@@ -387,7 +387,16 @@ util_normalize_filename(char *buffer, const char *filename, size_t length)
char *tmp = buffer;
for (size_t i=0; *filename != 0 && i<length-1; i++, filename++, buffer++)
{
- *buffer = *filename == '/' ? '_' : *filename;
+ switch (*filename)
+ {
+ case '/':
+ case '#':
+ *buffer = '_';
+ break;
+ default :
+ *buffer = *filename;
+ break;
+ }
}
*buffer = 0;
return tmp;