From a3c61c6aea4045a6adafcc7350bd14f1e9c68ca1 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Thu, 12 Apr 2012 22:03:49 +0530 Subject: libglusterfs: loc_copy should set name only if src->name is set Change-Id: If06d97dd1ff1293730e0cd4933f6ab3283f0475e BUG: 788051 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.com/3137 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- libglusterfs/src/xlator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c index f956908bba3..1bff11fecde 100644 --- a/libglusterfs/src/xlator.c +++ b/libglusterfs/src/xlator.c @@ -577,7 +577,8 @@ loc_copy (loc_t *dst, loc_t *src) if (!dst->path) goto out; - dst->name = strrchr (dst->path, '/'); + if (src->name) + dst->name = strrchr (dst->path, '/'); if (dst->name) dst->name++; } -- cgit