diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2014-07-05 06:39:14 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2014-07-05 06:39:14 +0000 |
commit | 6d5225ff3f2cd50c94558a1d331aed8ef6053103 (patch) | |
tree | 57093f3db7ceda2becc84dfcc5d11cf23954d483 /usr.bin/rdistd | |
parent | 3a16bc8e4b527e3c3f136faf6906e4f8577c2205 (diff) |
Stop using silly macro when checking for '.' and '..' directory entries
Diffstat (limited to 'usr.bin/rdistd')
-rw-r--r-- | usr.bin/rdistd/server.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/rdistd/server.c b/usr.bin/rdistd/server.c index 98f89c98a37..aab44a3058a 100644 --- a/usr.bin/rdistd/server.c +++ b/usr.bin/rdistd/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.25 2013/10/27 18:31:24 guenther Exp $ */ +/* $OpenBSD: server.c,v 1.26 2014/07/05 06:39:13 guenther Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. @@ -345,9 +345,8 @@ removefile(struct stat *statb, int silent) optarget = ptarget; len = ptarget - target; while ((dp = readdir(d)) != NULL) { - if ((D_NAMLEN(dp) == 1 && dp->d_name[0] == '.') || - (D_NAMLEN(dp) == 2 && dp->d_name[0] == '.' && - dp->d_name[1] == '.')) + if (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || + dp->d_name[1] == '.' && dp->d_name[2] == '\0')) continue; if (len + 1 + (int)strlen(dp->d_name) >= MAXPATHLEN - 1) { |