summaryrefslogtreecommitdiffstats
path: root/source3/lib/util.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2002-01-27 16:37:12 +0000
committerSimo Sorce <idra@samba.org>2002-01-27 16:37:12 +0000
commitc889c29d0d816a2f5641dabaa4c3c7ebdc60b5a8 (patch)
tree5e8f05b8b3b8a3ae4df21b7d4bffe4b70c2f7771 /source3/lib/util.c
parent7b671e34f599b9d27c615c1be35db4ae10ce6481 (diff)
downloadsamba-c889c29d0d816a2f5641dabaa4c3c7ebdc60b5a8.tar.gz
samba-c889c29d0d816a2f5641dabaa4c3c7ebdc60b5a8.tar.xz
samba-c889c29d0d816a2f5641dabaa4c3c7ebdc60b5a8.zip
minor fix and checks
(This used to be commit a034bfb9ef7a4c8a127ac91f4163cc6af98f29b3)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index d548f48e851..021f8c0edf5 100644
--- a/source3/lib/util.c
+++ b/source3/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('*'):