aboutsummaryrefslogtreecommitdiff
path: root/io/fts.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-09-06 23:45:24 +0000
committerUlrich Drepper <drepper@redhat.com>1998-09-06 23:45:24 +0000
commit6796bc807aa3808f6afb5da42932e437bdd183cf (patch)
treef0610b5aebf183e95afb9f70c30d77ea82f9ef9e /io/fts.c
parentbaa3334acc20834b32be1abf96f5942367c31a06 (diff)
downloadglibc-6796bc807aa3808f6afb5da42932e437bdd183cf.zip
glibc-6796bc807aa3808f6afb5da42932e437bdd183cf.tar.gz
glibc-6796bc807aa3808f6afb5da42932e437bdd183cf.tar.bz2
Update.
1998-09-06 09:53 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu> * Makeconfig (+gccwarn): Remove -Wno-parentheses. * elf/dl-open.c: Quiet -Wparentheses warnings. * iconvdata/johab.c: Likewise. * iconvdata/uhc.c: Likewise. * inet/inet_net.c: Likewise. * io/fts.c: Likewise. * locale/newlocale.c: Likewise. * misc/getttyent.c: Likewise. * misc/mntent_r.c: Likewise. * misc/ttyslot.c: Likewise. * nscd/nscd_conf.c: Likewise. * nss/nsswitch.c: Likewise. * resolv/gethnamaddr.c: Likewise. * resolv/nsap_addr.c: Likewise. * resolv/res_debug.c: Likewise. * stdio-common/_itoa.c: Likewise. * stdlib/strtod.c: Likewise. * string/strverscmp.c: Likewise. * sunrpc/svc.c: Likewise. * sysdeps/libm-ieee754/e_cosh.c: Likewise. * sysdeps/libm-ieee754/e_gamma_r.c: Likewise. * sysdeps/libm-ieee754/e_sinh.c: Likewise. * sysdeps/posix/getaddrinfo.c: Likewise. * include/dlfcn.h: Likewise. * elf/dlfcn.h: Declare dladdr only for __USE_GNU. Define RTLD_DEFAULT.
Diffstat (limited to 'io/fts.c')
-rw-r--r--io/fts.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/io/fts.c b/io/fts.c
index 75bba1f..4c57084 100644
--- a/io/fts.c
+++ b/io/fts.c
@@ -74,7 +74,7 @@ static u_short fts_stat __P((FTS *, struct dirent *, FTSENT *, int))
_a > _b ? _a : _b; })
#endif
-#define ISDOT(a) (a[0] == '.' && (!a[1] || a[1] == '.' && !a[2]))
+#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])))
#define ISSET(opt) (sp->fts_options & opt)
#define SET(opt) (sp->fts_options |= opt)
@@ -326,7 +326,7 @@ fts_read(sp)
if (p->fts_info == FTS_D) {
/* If skipped or crossed mount point, do post-order visit. */
if (instr == FTS_SKIP ||
- ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev) {
+ (ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev)) {
if (p->fts_flags & FTS_SYMFOLLOW)
(void)__close(p->fts_symfd);
if (sp->fts_child) {
@@ -376,7 +376,7 @@ fts_read(sp)
/* Move to the next node on this level. */
next: tmp = p;
- if (p = p->fts_link) {
+ if ((p = p->fts_link)) {
free(tmp);
/*
@@ -674,7 +674,9 @@ fts_build(sp, type)
/* Read the directory, attaching each entry to the `link' pointer. */
adjaddr = NULL;
- for (head = tail = NULL, nitems = 0; dp = __readdir(dirp);) {
+ head = tail = NULL;
+ nitems = 0;
+ while((dp = __readdir(dirp))) {
int namlen;
if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
@@ -717,8 +719,8 @@ mem1: saved_errno = errno;
p->fts_accpath = cur->fts_accpath;
} else if (nlinks == 0
#if defined DT_DIR && defined _DIRENT_HAVE_D_TYPE
- || nlinks > 0 &&
- dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN
+ || (nlinks > 0 &&
+ dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN)
#endif
) {
p->fts_accpath =
@@ -964,7 +966,7 @@ fts_lfree(head)
register FTSENT *p;
/* Free a linked list of structures. */
- while (p = head) {
+ while ((p = head)) {
head = head->fts_link;
free(p);
}