/*
- * $Id: desktop.c,v 1.45 2009-10-29 13:38:15 didg Exp $
+ * $Id: desktop.c,v 1.46 2009-11-09 01:36:18 didg Exp $
*
* See COPYRIGHT.
*
char *m, *u;
size_t inplen;
size_t outlen;
- u_int16_t flags = 0;
+ u_int16_t flags;
if ( *mpath == '\0' ) {
return( "." );
}
/* set conversion flags */
- if (!(vol->v_flags & AFPVOL_NOHEX))
- flags |= CONV_ESCAPEHEX;
- if (!(vol->v_flags & AFPVOL_USEDOTS))
- flags |= CONV_ESCAPEDOTS;
-
- if ((vol->v_casefold & AFPVOL_MTOUUPPER))
- flags |= CONV_TOUPPER;
- else if ((vol->v_casefold & AFPVOL_MTOULOWER))
- flags |= CONV_TOLOWER;
-
- if ((vol->v_flags & AFPVOL_EILSEQ)) {
- flags |= CONV__EILSEQ;
- }
-
+ flags = vol->v_mtou_flags;
+
m = demangle(vol, mpath, did);
if (m != mpath) {
return m;
{
static char mpath[ MAXPATHLEN + 2]; /* for convert_charset dest_len parameter +2 */
char *m, *u;
- u_int16_t flags = CONV_IGNORE | CONV_UNESCAPEHEX;
+ u_int16_t flags;
size_t outlen;
m = mpath;
outlen = strlen(upath);
- if ((vol->v_casefold & AFPVOL_UTOMUPPER))
- flags |= CONV_TOUPPER;
- else if ((vol->v_casefold & AFPVOL_UTOMLOWER))
- flags |= CONV_TOLOWER;
-
- if ((vol->v_flags & AFPVOL_EILSEQ)) {
- flags |= CONV__EILSEQ;
- }
+ flags = vol->v_utom_flags;
u = upath;
goto utompath_error;
}
- if (!(flags & CONV_REQMANGLE))
- flags = 0;
- else
- flags = 1;
+ flags = !!(flags & CONV_REQMANGLE);
if (utf8)
flags |= 2;
/*
- * $Id: volume.c,v 1.100 2009-11-08 23:17:40 didg Exp $
+ * $Id: volume.c,v 1.101 2009-11-09 01:36:18 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
else
volume->v_adouble = AD_VERSION;
+ /* Mac to Unix conversion flags*/
+ volume->v_mtou_flags = 0;
+ if (!(volume->v_flags & AFPVOL_NOHEX))
+ volume->v_mtou_flags |= CONV_ESCAPEHEX;
+ if (!(volume->v_flags & AFPVOL_USEDOTS))
+ volume->v_mtou_flags |= CONV_ESCAPEDOTS;
+ if ((volume->v_flags & AFPVOL_EILSEQ))
+ volume->v_mtou_flags |= CONV__EILSEQ;
+
+ if ((volume->v_casefold & AFPVOL_MTOUUPPER))
+ volume->v_mtou_flags |= CONV_TOUPPER;
+ else if ((volume->v_casefold & AFPVOL_MTOULOWER))
+ volume->v_mtou_flags |= CONV_TOLOWER;
+
+ /* Unix to Mac conversion flags*/
+ volume->v_utom_flags = CONV_IGNORE | CONV_UNESCAPEHEX;
+ if ((volume->v_casefold & AFPVOL_UTOMUPPER))
+ volume->v_utom_flags |= CONV_TOUPPER;
+ else if ((volume->v_casefold & AFPVOL_UTOMLOWER))
+ volume->v_utom_flags |= CONV_TOLOWER;
+
+ if ((volume->v_flags & AFPVOL_EILSEQ))
+ volume->v_utom_flags |= CONV__EILSEQ;
+
initvol_vfs(volume);
+
#ifdef FORCE_UIDGID
if (options[VOLOPT_FORCEUID].c_value) {
volume->v_forceuid = strdup(options[VOLOPT_FORCEUID].c_value);
/*
- * $Id: volume.h,v 1.4 2009-11-08 23:17:40 didg Exp $
+ * $Id: volume.h,v 1.5 2009-11-09 01:36:18 didg Exp $
*
* Copyright (c) 1990,1994 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
charset_t v_volcharset;
charset_t v_maccharset;
+
+ u_int16_t v_mtou_flags; /* flags for convert_charset in mtoupath */
+ u_int16_t v_utom_flags;
+
long v_kTextEncoding; /* mac charset encoding in network order
* XXX should be a u_int32_t ?
*/
-
- int v_casefold;
size_t max_filename;
char *v_veto;
int v_nfs;
/* only when opening/closing volumes or in error */
+ int v_casefold;
+
char *v_localname; /* as defined in AppleVolumes.default */
char *v_volcodepage;
char *v_maccodepage;