/*
- * $Id: directory.c,v 1.71.2.4.2.15.2.8 2005-09-27 10:40:41 didg Exp $
+ * $Id: directory.c,v 1.71.2.4.2.15.2.10 2008-11-25 15:16:32 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
/* remove the node from the tree. this is just like insertion, but
* different. actually, it has to worry about a bunch of things that
* insertion doesn't care about. */
-static void dir_remove( vol, dir )
-struct vol *vol;
-struct dir *dir;
+static void dir_remove( const struct vol *vol _U_, struct dir *dir)
{
#ifdef REMOVE_NODES
struct ofork *of, *last;
}
+/* --------------------- */
+static int invisible_dots(const struct vol *vol, const char *name)
+{
+ return vol_inv_dots(vol) && *name == '.' && strcmp(name, ".") && strcmp(name, "..");
+}
+
/* ------------------------------
(".", curdir)
(name, dir) with curdir:name == dir, from afp_enumerate
case DIRPBIT_ATTR :
if ( isad ) {
ad_getattr(&ad, &ashort);
- } else if (*dir->d_u_name == '.' && strcmp(dir->d_u_name, ".")
- && strcmp(dir->d_u_name, "..")) {
+ } else if (invisible_dots(vol, dir->d_u_name)) {
ashort = htons(ATTRBIT_INVISIBLE);
} else
ashort = 0;
ashort = htons(FINDERINFO_CLOSEDVIEW);
memcpy(data + FINDERINFO_FRVIEWOFF, &ashort, sizeof(ashort));
- /* dot files are by default invisible */
- if (*dir->d_u_name == '.' && strcmp(dir->d_u_name , ".") &&
- strcmp(dir->d_u_name , "..")) {
+ /* dot files are by default visible */
+ if (invisible_dots(vol, dir->d_u_name)) {
ashort = htons(FINDERINFO_INVISIBLE);
- memcpy(data + FINDERINFO_FRFLAGOFF,
- &ashort, sizeof(ashort));
+ memcpy(data + FINDERINFO_FRFLAGOFF, &ashort, sizeof(ashort));
}
}
data += 32;
0,
"", /* mac name */
".", /* unix name */
+ NULL,
0, /* stat is not set */
- 0, /* */
+ 0 /* errno */
};
/* ------------------ */
#define DOT_APPLEDOUBLE_LEN 13
/* delete an empty directory */
-int deletecurdir( vol, path, pathlen )
+int deletecurdir( vol, path )
const struct vol *vol;
char *path;
-int pathlen;
{
struct dirent *de;
struct stat st;