use S_ISDIR and S_ISREG

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25229 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2009-05-25 23:44:52 +00:00
parent dccd572c45
commit 1e5a14f8bd

View File

@@ -292,16 +292,10 @@ source(int argc, char **argv)
syserr: run_err("%s: %s", name, strerror(errno)); syserr: run_err("%s: %s", name, strerror(errno));
goto next; goto next;
} }
switch (stb.st_mode & S_IFMT) { if (S_ISDIR(stb.st_mode) && iamrecursive) {
case S_IFREG:
break;
case S_IFDIR:
if (iamrecursive) {
rsource(name, &stb); rsource(name, &stb);
goto next; goto next;
} } else if (!S_ISREG(stb.st_mode)) {
/* FALLTHROUGH */
default:
run_err("%s: not a regular file", name); run_err("%s: not a regular file", name);
goto next; goto next;
} }