summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2002-01-25 00:35:14 +0000
committerSimo Sorce <idra@samba.org>2002-01-25 00:35:14 +0000
commit114eaabdcbacf626ccb452a2d4f695b183dd738b (patch)
tree3084d9285342cce6ecfa3edf1062df3ea8bd0421 /source3/lib/util.c
parentca12d82eaf4c6bd498208a246ca8a1ca9f47c58b (diff)
downloadsamba-114eaabdcbacf626ccb452a2d4f695b183dd738b.tar.gz
samba-114eaabdcbacf626ccb452a2d4f695b183dd738b.tar.bz2
samba-114eaabdcbacf626ccb452a2d4f695b183dd738b.zip
minor fixes
(This used to be commit 04f492980b73800b60dde764fdeb43f2eab79624)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 97ff4e24a0..2b71b3cb3d 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -449,13 +449,14 @@ smb_ucs2_t *unix_clean_path(const smb_ucs2_t *s)
/* reduce any /../ */
t = ns;
- while ((r = strstr_wa(t, "/.."))) {
+ while (*t && (r = strstr_wa(t, "/.."))) {
t = &(r[3]);
if (*t == UCS2_CHAR('/') || *t == 0) {
*r = 0;
p = strrchr_w(ns, UCS2_CHAR('/'));
if (!p) p = ns;
- memmove(p, t, (strlen_w(t) + 1) * sizeof(smb_ucs2_t));
+ if (*t == 0) *p = 0;
+ else memmove(p, t, (strlen_w(t) + 1) * sizeof(smb_ucs2_t));
t = p;
}
}