summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 44184f8d46..a43de46c51 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1185,7 +1185,11 @@ void unix_clean_name(char *s)
string_sub(s, "//","/");
/* Remove leading ./ characters */
- trim_string(s, "./", NULL);
+ if(strncmp(s, "./", 2) == 0) {
+ trim_string(s, "./", NULL);
+ if(*s == 0)
+ strcpy(s,"./");
+ }
while ((p = strstr(s,"/../")) != NULL)
{
@@ -1381,6 +1385,10 @@ BOOL reduce_name(char *s,char *dir,BOOL widelinks)
DEBUG(3,("Illegal file name? (%s)\n",s));
return(False);
}
+
+ if (strlen(s) == 0)
+ strcpy(s,"./");
+
return(True);
}