/*
- * $Id: directory.c,v 1.126 2010-01-06 15:37:01 franklahm Exp $
+ * $Id: directory.c,v 1.127 2010-01-10 10:58:24 franklahm Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
int afp_errno;
#define SENTINEL (&sentinel)
-static struct dir sentinel = { SENTINEL, SENTINEL, NULL, DIRTREE_COLOR_BLACK,
- NULL, NULL, NULL, NULL, NULL, 0, 0,
- 0, 0, NULL, NULL, 0, NULL};
-static struct dir rootpar = { SENTINEL, SENTINEL, NULL, 0,
- NULL, NULL, NULL, NULL, NULL, 0, 0,
- 0, 0, NULL, NULL, 0, NULL};
+static struct dir sentinel = { SENTINEL, SENTINEL, NULL, /* left, right, back */
+ DIRTREE_COLOR_BLACK, /* color */
+ NULL, NULL, /* parent, child */
+ NULL, NULL, /* previous, next */
+ NULL, 0, 0, /* oforks, did, flags */
+ 0, 0, /* ctime, offcnt */
+ NULL, NULL, NULL}; /* mname, uname, ucs2-name */
+static struct dir rootpar = { SENTINEL, SENTINEL, NULL,
+ 0,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, 0, 0,
+ 0, 0,
+ NULL, NULL, NULL};
/* (from IM: Toolbox Essentials)
* dirFinderInfo (DInfo) fields:
key.d_parent = cdir;
key.d_u_name = name;
- key.d_u_name_len = strlen(name);
hn = hash_lookup(vol->v_hash, &key);
if (hn) {
dir = hnode_get(hn);
dirfreename(edir);
edir->d_m_name = cdir->d_m_name;
edir->d_u_name = cdir->d_u_name;
- edir->d_u_name_len = cdir->d_u_name_len;
edir->d_m_name_ucs2 = cdir->d_m_name_ucs2;
free(cdir);
cdir = edir;
return NULL;
}
- dir->d_u_name_len = strlen(dir->d_u_name);
dir->d_m_name_ucs2 = NULL;
dir->d_left = dir->d_right = SENTINEL;
dir->d_next = dir->d_prev = dir;
{
const struct dir *k = key;
const char *data = k->d_u_name;
- int len = k->d_u_name_len;
+ int len = strlen(k->d_u_name);
hash_val_t hash = k->d_parent->d_did, tmp;
int rem = len & 3;
dir->d_u_name = buf;
strcpy( dir->d_u_name, dst );
}
- dir->d_u_name_len = strlen(dir->d_u_name);
if (dir->d_m_name_ucs2)
free(dir->d_m_name_ucs2);