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