SCCS-vsn: usr.bin/xinstall/xinstall.c 5.9
#endif not lint
#ifndef lint
#endif not lint
#ifndef lint
-static char sccsid[] = "@(#)xinstall.c 5.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)xinstall.c 5.9 (Berkeley) %G%";
#endif not lint
#include <sys/param.h>
#endif not lint
#include <sys/param.h>
}
no_target = stat(to_name = argv[argc - 1], &to_sb);
}
no_target = stat(to_name = argv[argc - 1], &to_sb);
- if (!no_target && to_sb.st_mode & S_IFDIR) {
+ if (!no_target && (to_sb.st_mode & S_IFMT) == S_IFDIR) {
for (; *argv != to_name; ++argv)
install(*argv, to_name, YES);
exit(0);
for (; *argv != to_name; ++argv)
install(*argv, to_name, YES);
exit(0);
fprintf(stderr, "install: can't find %s.\n", *argv);
exit(1);
}
fprintf(stderr, "install: can't find %s.\n", *argv);
exit(1);
}
- if (!(to_sb.st_mode & S_IFREG)) {
+ if ((to_sb.st_mode & S_IFMT) != S_IFREG) {
fprintf(stderr, "install: %s isn't a regular file.\n", to_name);
exit(1);
}
fprintf(stderr, "install: %s isn't a regular file.\n", to_name);
exit(1);
}
fprintf(stderr, "install: can't find %s.\n", from_name);
exit(1);
}
fprintf(stderr, "install: can't find %s.\n", from_name);
exit(1);
}
- if (!(from_sb.st_mode & S_IFREG)) {
+ if ((from_sb.st_mode & S_IFMT) != S_IFREG) {
fprintf(stderr, "install: %s isn't a regular file.\n", from_name);
exit(1);
}
fprintf(stderr, "install: %s isn't a regular file.\n", from_name);
exit(1);
}