diff options
author | Simo Sorce <idra@samba.org> | 2002-01-27 16:37:12 +0000 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2002-01-27 16:37:12 +0000 |
commit | a034bfb9ef7a4c8a127ac91f4163cc6af98f29b3 (patch) | |
tree | 880ab3a9d88aaf19e2bbcbfcc2ab370f7558fab4 /source | |
parent | f1d8d509766e9169d39332559162cfec249bfc70 (diff) | |
download | samba-a034bfb9ef7a4c8a127ac91f4163cc6af98f29b3.tar.gz samba-a034bfb9ef7a4c8a127ac91f4163cc6af98f29b3.tar.xz samba-a034bfb9ef7a4c8a127ac91f4163cc6af98f29b3.zip |
minor fix and checks
Diffstat (limited to 'source')
-rw-r--r-- | source/lib/util.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/lib/util.c b/source/lib/util.c index d548f48e851..021f8c0edf5 100644 --- a/source/lib/util.c +++ b/source/lib/util.c @@ -429,6 +429,7 @@ smb_ucs2_t *unix_clean_path(const smb_ucs2_t *s) smb_ucs2_t *p, *r, *t; DEBUG(3, ("unix_clean_path\n")); /* [%unicode]\n")); */ + if(!s) return NULL; /* convert '\' to '/' */ ns = strdup_w(s); @@ -461,8 +462,8 @@ smb_ucs2_t *unix_clean_path(const smb_ucs2_t *s) } } - /* remove any trailing /. */ - trim_string_wa(ns, NULL, "/."); + /* remove any leading ./ trailing /. */ + trim_string_wa(ns, "./", "/."); /* remove any leading and trailing / */ trim_string_wa(ns, "/", "/"); @@ -1916,6 +1917,7 @@ BOOL ms_has_wild(char *s) BOOL ms_has_wild_w(const smb_ucs2_t *s) { smb_ucs2_t c; + if (!s) return False; while ((c = *s++)) { switch (c) { case UCS2_CHAR('*'): |