svn commit: samba r17753 - in
branches/SAMBA_4_0/source/ntvfs/posix: .
metze at samba.org
metze at samba.org
Wed Aug 23 13:14:03 GMT 2006
Author: metze
Date: 2006-08-23 13:14:03 +0000 (Wed, 23 Aug 2006)
New Revision: 17753
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=17753
Log:
fix compiler warnings and make the code simpler
metze
Modified:
branches/SAMBA_4_0/source/ntvfs/posix/pvfs_shortname.c
Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_shortname.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_shortname.c 2006-08-23 13:06:31 UTC (rev 17752)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_shortname.c 2006-08-23 13:14:03 UTC (rev 17753)
@@ -313,8 +313,8 @@
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 @@
}
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 @@
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);
}
More information about the samba-cvs
mailing list