* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
#ifndef lint
static const char rcsid[] =
- "$Id: dirs.c,v 1.18 2002/02/04 11:18:46 stelian Exp $";
+ "$Id: dirs.c,v 1.23 2003/03/30 15:40:38 stelian Exp $";
#endif /* not lint */
#include <config.h>
* skipping over "." and ".."
*/
namelen = snprintf(locname, sizeof(locname), "%s/", pname);
- if (namelen >= sizeof(locname))
+ if (namelen >= (int)sizeof(locname))
namelen = sizeof(locname) - 1;
rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt);
dp = rst_readdir(dirp); /* "." */
*/
while (dp != NULL) {
locname[namelen] = '\0';
- if (namelen + dp->d_namlen >= sizeof(locname)) {
+ if (namelen + dp->d_namlen >= (int)sizeof(locname)) {
fprintf(stderr, "%s%s: name exceeds %ld char\n",
locname, dp->d_name, (long)sizeof(locname) - 1);
} else {
putent(&cvtbuf);
}
} else {
- for (loc = 0; loc < size; ) {
+ for (loc = 0; loc < (long)size; ) {
dp = (struct direct *)(buf + loc);
#ifdef DIRDEBUG
printf ("reclen = %d, namlen = %d, type = %d\n",
if (!Bcvt)
dp->d_namlen = dp->d_type;
# endif
+ if (dp->d_namlen == 0 && dp->d_type != 0)
+ dp->d_namlen = dp->d_type;
dp->d_type = DT_UNKNOWN;
}
#ifdef DIRDEBUG
rst_telldir(RST_DIR *dirp)
{
return ((long)lseek(dirp->dd_fd,
- (off_t)0, SEEK_CUR) - dirp->dd_size + dirp->dd_loc);
+ (OFF_T)0, SEEK_CUR) - dirp->dd_size + dirp->dd_loc);
}
/*
ep->e_flags &= ~NEW;
continue;
}
- if (node.ino == ROOTINO &&
+ if ((flags & FORCE) == 0 &&
+ node.ino == ROOTINO &&
reply("set owner/mode for '.'") == FAIL)
continue;
}