]> arthur.barton.de Git - netatalk.git/commitdiff
codepage fix from Axel Barnitzek (barney@users.sourceforge.net), keeping ChangeLog...
authorrufustfirefly <rufustfirefly>
Fri, 23 Feb 2001 15:35:36 +0000 (15:35 +0000)
committerrufustfirefly <rufustfirefly>
Fri, 23 Feb 2001 15:35:36 +0000 (15:35 +0000)
ChangeLog
etc/afpd/codepage.c
etc/afpd/desktop.c
etc/afpd/nls/makecode.c

index d9a2d58f33d49ee854138ebfc3648475908873db..fc48afc4abde2b0e93ef93074a51da71dbbbfc60 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+
+2001-02-23  jeff b  <jeff@univrel.pr.uconn.edu>  
+
+       * etc/afpd/desktop.c, etc/afpd/codepage.c, etc/afpd/nls/makecode.c:
+       patch from Axel Barnitzek <barney@users.sourceforge.net> to fix
+       broken codepage support.
+
+       * ChangeLog: started updaing ChangeLog with important patch/fix
+       information, as it is *never* up to date.
+
+2001-02-20  jeff b  <jeff@univrel.pr.uconn.edu>
+
+       Released 1.5pre3
+       - Debian packaging in tree
+       - Numerous Makefile/build fixes
+       - .cvsignore implemented
+       - Solaris build fixes
+
 2001-01-02  jeff b  <jeff@univrel.pr.uconn.edu>
 
        * etc/afpd/uid.c, etc/afpd/uid.h, ...: added support for forcing
index 084be7ddd7cb6c34dbe2ed973af008036e8399ba..de6eeb51dd6521587694fa094f1c9f42065a2f68 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * $Id: codepage.c,v 1.3 2001-02-23 15:35:37 rufustfirefly Exp $
+ *
  * Copyright (c) 2000 Adrian Sun
  * All Rights Reserved. See COPYRIGHT.
  *
@@ -14,7 +16,6 @@
  * the badumap specifies illegal characters. these are 8-bit values
  * with an associated rule field. here are the rules:
  *   
- *
  * illegal values: 0 is the only illegal value. no translation will
  * occur in those cases.  
  */
@@ -144,16 +145,16 @@ static void free_codepage(struct codepage *cp)
 int codepage_init(struct vol *vol, const int rules, 
                  const int quantum)
 {
-  if ((rules & CODEPAGE_RULE_MTOU) && !vol->v_utompage) {
+  if ((rules & CODEPAGE_RULE_UTOM) && !vol->v_utompage) {
     vol->v_utompage = init_codepage(quantum);
     if (!vol->v_utompage)
-      return -1;
+      goto err_utompage;
   }
 
-  if ((rules & CODEPAGE_RULE_UTOM) && !vol->v_mtoupage) {
+  if ((rules & CODEPAGE_RULE_MTOU) && !vol->v_mtoupage) {
     vol->v_mtoupage = init_codepage(quantum);
     if (!vol->v_mtoupage) {
-      goto err_utompage;
+      goto err_mtoupage;
     }
   }
 
@@ -226,6 +227,9 @@ int codepage_read(struct vol *vol, const char *path)
       goto codepage_fail;
   } 
 
+  /* ignore namelen */
+  cur++;
+
   /* find out the data quantum size. default to 1 if nothing's given. */
   quantum = *cur ? *cur : 1;
   cur++;
index f1de3e391fa076365ba9731d9b5196ecb44d92e7..3ef29e729e2db62c4c9b058f81ffd5f9b8d81e82 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 1990,1993 Regents of The University of Michigan.
- * All Rights Reserved.  See COPYRIGHT.
+ * $Id: desktop.c,v 1.3 2001-02-23 15:35:37 rufustfirefly Exp $
+ * See COPYRIGHT.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -616,10 +616,10 @@ char *mtoupath(const struct vol *vol, char *mpath)
        
        /* we have a code page. we only use the ascii range
         * if we have map ascii specified. */
-#if 0
+#if 1
        if (vol->v_mtoupage && ((*m > 0x7F) ||
                                vol->v_flags & AFPVOL_MAPASCII)) {
-           *u = vol->v_mtoupage[*m];
+           *u = vol->v_mtoupage->map[*m].value;
        } else
 #endif
 #if AD_VERSION == AD_VERSION1
@@ -662,10 +662,10 @@ char *utompath(const struct vol *vol, char *upath)
     m = mpath;
     while ( *u != '\0' ) {
         /* we have a code page */
-#if 0
+#if 1
         if (vol->v_utompage && ((*u > 0x7F) ||
                                (vol->v_flags & AFPVOL_MAPASCII))) {
-           *m = vol->v_utompage[*u];
+           *m = vol->v_utompage->map[*u].value;
        } else 
 #endif
          if ( *u == ':' && *(u+1) != '\0' && islxdigit( *(u+1)) &&
index dbe0ef547498a73f57bfa9416ae58b128c92ebd1..f4917d088532a501ceb3cf0501db5235b1326295 100644 (file)
@@ -1,4 +1,12 @@
-/* quick-and-dirty way of creating code pages */
+/*
+ * $Id: makecode.c,v 1.3 2001-02-23 15:35:37 rufustfirefly Exp $
+ *
+ * quick-and-dirty way of creating code pages
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -96,6 +104,8 @@ int main(int argc, char **argv)
       continue;
     }
 
+    memset(buf, 0, CODEPAGE_FILE_HEADER_SIZE);
+
     id = htons(CODEPAGE_FILE_ID); /* file id */
     memcpy(buf, &id, sizeof(id));
     *(buf + 2) = CODEPAGE_FILE_VERSION; /* version */
@@ -115,7 +125,7 @@ int main(int argc, char **argv)
 
     /* size of data */
     id = htons(names[i].m_len); 
-    memcpy(buf + 7, &id, sizeof(id));
+    memcpy(buf + 8, &id, sizeof(id));
 
     /* write it out */
     fwrite(buf, CODEPAGE_FILE_HEADER_SIZE, 1, fp);
@@ -133,6 +143,5 @@ int main(int argc, char **argv)
     }
     fclose(fp);
   }
-
   return 0;
 }