]> arthur.barton.de Git - netatalk.git/commitdiff
use 0 0 for default creator/type rather than UNIX TEXT, from Shlomi
authordidg <didg>
Tue, 7 Sep 2004 06:17:20 +0000 (06:17 +0000)
committerdidg <didg>
Tue, 7 Sep 2004 06:17:20 +0000 (06:17 +0000)
Yaakobovich.

etc/afpd/desktop.c
etc/afpd/file.c
libatalk/adouble/ad_open.c

index 946180888be3e85980beb81e62c7933178e55fda..add6c2110f5aa03bee3f3f3734760af2c8455680 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: desktop.c,v 1.26.2.4.2.15 2004-06-20 15:30:04 bfernhomberg Exp $
+ * $Id: desktop.c,v 1.26.2.4.2.16 2004-09-07 06:17:20 didg Exp $
  *
  * See COPYRIGHT.
  *
@@ -309,11 +309,11 @@ addicon_err:
     return( AFP_OK );
 }
 
-u_char utag[] = { 0, 0, 0, 0 };
-u_char ucreator[] = { 'U', 'N', 'I', 'X' };
-u_char utype[] = { 'T', 'E', 'X', 'T' };
-short  usize = 256;
-u_char uicon[] = {
+static u_char  utag[] = { 0, 0, 0, 0 };
+static u_char  ucreator[] = { '0', '0', '0', '0' };/* { 'U', 'N', 'I', 'X' };*/
+static u_char  utype[] = { '0', '0', '0', '0' };/* { 'T', 'E', 'X', 'T' };*/
+static short   usize = 256;
+static u_char  uicon[] = {
     0x1F, 0xFF, 0xFC, 0x00, 0x10, 0x00, 0x06, 0x00,
     0x10, 0x00, 0x05, 0x00, 0x10, 0x00, 0x04, 0x80,
     0x10, 0x00, 0x04, 0x40, 0x10, 0x00, 0x04, 0x20,
index 0df32b5cbcbe5135de67115a79f3662e321779be..a0ffe5d5f159775d00667051448a0a859a3a3cb1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: file.c,v 1.92.2.2.2.30 2004-09-06 09:38:21 didg Exp $
+ * $Id: file.c,v 1.92.2.2.2.31 2004-09-07 06:17:21 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -69,7 +69,7 @@ char *strchr (), *strrchr ();
  */
 
 const u_char ufinderi[] = {
-                              'T', 'E', 'X', 'T', 'U', 'N', 'I', 'X',
+                              0, 0, 0, 0, 0, 0, 0, 0,
                               0, 0, 0, 0, 0, 0, 0, 0,
                               0, 0, 0, 0, 0, 0, 0, 0,
                               0, 0, 0, 0, 0, 0, 0, 0
@@ -79,18 +79,21 @@ const u_char ufinderi[] = {
 void *get_finderinfo(const char *mpath, struct adouble *adp, void *data)
 {
     struct extmap      *em;
-    void                *ad_finder;
+    void                *ad_finder = NULL;
+    int                 chk_ext = 0;
+    
+    if (adp)
+        ad_finder = ad_entry(adp, ADEID_FINDERI);
 
-    if (adp && (ad_finder = ad_entry(adp, ADEID_FINDERI))) {
+    if ((adp != NULL) && (ad_finder != NULL)) {
         memcpy(data, ad_finder, 32);
     }
     else {
         memcpy(data, ufinderi, 32);
+        chk_ext = 1;
     }
-
-    if ((!adp  || !memcmp(ad_entry(adp, ADEID_FINDERI),ufinderi , 8 )) 
-               && (em = getextmap( mpath ))
-    ) {
+    /** Only enter if no appledouble information and no finder information found. */
+    if (chk_ext && (em = getextmap( mpath ))) {
         memcpy(data, em->em_type, sizeof( em->em_type ));
         memcpy((char *)data + 4, em->em_creator, sizeof(em->em_creator));
     }
index e189ba4f7ee2ba6ccf6602fe645734cd5892a92d..cdae5c09295e89cfb8aebccbac1a350320686977 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ad_open.c,v 1.30.6.17 2004-08-23 22:27:02 bfernhomberg Exp $
+ * $Id: ad_open.c,v 1.30.6.18 2004-09-07 06:17:22 didg Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu)
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -1192,8 +1192,8 @@ static int new_rfork(const char *path, struct adouble *ad, int adflags)
                     &ashort, sizeof(ashort));
     } else {
         /* set default creator/type fields */
-       memcpy(ad_entry(ad, ADEID_FINDERI) + FINDERINFO_FRTYPEOFF,"TEXT", 4);
-       memcpy(ad_entry(ad, ADEID_FINDERI) + FINDERINFO_FRCREATOFF,"UNIX", 4);
+       memcpy(ad_entry(ad, ADEID_FINDERI) + FINDERINFO_FRTYPEOFF,"\0\0\0\0", 4);
+       memcpy(ad_entry(ad, ADEID_FINDERI) + FINDERINFO_FRCREATOFF,"\0\0\0\0", 4);
     }
 
     /* make things invisible */