summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-08-23 13:14:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:16:37 -0500
commitec626a732cd5e3900c4db38b0b1ba9b19f9ccf5a (patch)
tree278a32c753afcbb306b2bbacab1cb5575d1e5281
parent312ded39cc08596fd3818ab81f25d2e9e09d7a3c (diff)
downloadsamba-ec626a732cd5e3900c4db38b0b1ba9b19f9ccf5a.tar.gz
samba-ec626a732cd5e3900c4db38b0b1ba9b19f9ccf5a.tar.bz2
samba-ec626a732cd5e3900c4db38b0b1ba9b19f9ccf5a.zip
r17753: fix compiler warnings and make the code simpler
metze (This used to be commit eda302ffa5458a34f78d733cd0a46e79a74e81d7)
-rw-r--r--source4/ntvfs/posix/pvfs_shortname.c15
1 files changed, 5 insertions, 10 deletions
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);
}