summaryrefslogtreecommitdiff
path: root/mdopen.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdopen.c')
-rw-r--r--mdopen.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/mdopen.c b/mdopen.c
index fdae7f3..4ef9308 100644
--- a/mdopen.c
+++ b/mdopen.c
@@ -289,8 +289,17 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
int cnlen;
strncpy(cname, name, 200);
cname[200] = 0;
- while ((cp = strchr(cname, '/')) != NULL)
- *cp = '-';
+ for (cp = cname; *cp ; cp++)
+ switch (*cp) {
+ case '/':
+ *cp = '-';
+ break;
+ case ' ':
+ case '\t':
+ *cp = '_';
+ break;
+ }
+
if (trustworthy == LOCAL ||
(trustworthy == FOREIGN && strchr(cname, ':') != NULL)) {
/* Only need suffix if there is a conflict */