From ec626a732cd5e3900c4db38b0b1ba9b19f9ccf5a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 23 Aug 2006 13:14:03 +0000 Subject: r17753: fix compiler warnings and make the code simpler metze (This used to be commit eda302ffa5458a34f78d733cd0a46e79a74e81d7) --- source4/ntvfs/posix/pvfs_shortname.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'source4/ntvfs/posix') diff --git a/source4/ntvfs/posix/pvfs_shortname.c b/source4/ntvfs/posix/pvfs_shortname.c index 8e26db3ed5..00647f1299 100644 --- a/source4/ntvfs/posix/pvfs_shortname.c +++ b/source4/ntvfs/posix/pvfs_shortname.c @@ -313,8 +313,8 @@ static BOOL is_8_3(struct pvfs_mangle_context *ctx, try to find a 8.3 name in the cache, and if found then return the original long name. */ -static const char *check_cache(struct pvfs_mangle_context *ctx, - const char *name) +static char *check_cache(struct pvfs_mangle_context *ctx, + TALLOC_CTX *mem_ctx, const char *name) { uint32_t hash, multiplier; unsigned int i; @@ -351,10 +351,10 @@ static const char *check_cache(struct pvfs_mangle_context *ctx, } if (extension[0]) { - return talloc_asprintf(ctx, "%s.%s", prefix, extension); + return talloc_asprintf(mem_ctx, "%s.%s", prefix, extension); } - return talloc_strdup(ctx, prefix); + return talloc_strdup(mem_ctx, prefix); } @@ -672,12 +672,7 @@ const char *pvfs_short_name(struct pvfs_state *pvfs, TALLOC_CTX *mem_ctx, char *pvfs_mangled_lookup(struct pvfs_state *pvfs, TALLOC_CTX *mem_ctx, const char *name) { - const char *ret; - ret = check_cache(pvfs->mangle_ctx, name); - if (ret) { - return talloc_steal(mem_ctx, ret); - } - return NULL; + return check_cache(pvfs->mangle_ctx, mem_ctx, name); } -- cgit