diff options
Diffstat (limited to 'mdopen.c')
-rw-r--r-- | mdopen.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -286,8 +286,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 */ |