]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/mangle.c
CatSearch fixes, base on TSUBAKIMOTO Hiroya patch.
[netatalk.git] / etc / afpd / mangle.c
index eb8cf78eb93d5558a57b4167d484d55cb0e61d41..5bd7baa3fa3840c7a277ab98dec59aed951ce68f 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * $Id: mangle.c,v 1.16.2.1.2.12.2.1 2005-01-31 19:50:37 didg Exp $ 
+ * $Id: mangle.c,v 1.16.2.1.2.12.2.2 2005-02-12 11:22:05 didg Exp $ 
  *
  * Copyright (c) 2002. Joe Marcus Clarke (marcus@marcuscom.com)
  * All Rights Reserved.  See COPYRIGHT.
@@ -245,6 +245,11 @@ mangle(const struct vol *vol, unsigned char *filename, size_t filenamelen, unsig
     if (!(flags & 1) && filenamelen <= maxlen) {
        return filename;
     }
+
+    if (!id) {
+        /* we don't have the file id! only catsearch call mangle with id == 0 */
+        return NULL;
+    }
     /* First, attempt to locate a file extension. */
     if (NULL != (ext = strrchr(uname, '.')) ) {
        ext_len = strlen(ext);