fstype: Fix reversed test for "-" on command line
The test for a "-" argument on the command line is reversed, so that
fstype will only attempt to open a file name provided on the command
line if it is "-", rather than only if it is not "-". This patch fixes
that.
Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
diff --git a/usr/kinit/fstype/main.c b/usr/kinit/fstype/main.c
index 7c81f24..0ceb593 100644
--- a/usr/kinit/fstype/main.c
+++ b/usr/kinit/fstype/main.c
@@ -37,7 +37,7 @@
return 1;
}
- if (argc > 1 && argv[1][0] == '-' && argv[1][1] == '\0') {
+ if (argc > 1 && !(argv[1][0] == '-' && argv[1][1] == '\0')) {
fd = open(file = argv[1], O_RDONLY);
if (fd < 0) {
perror(argv[1]);