aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Watson <cjwatson@ubuntu.com>2006-12-21 10:54:48 +0000
committerH. Peter Anvin <hpa@zytor.com>2007-01-15 19:53:57 -0800
commitab3ef87cfcc9d01d2cb7110408b7dfc81c3ffa8d (patch)
tree99c4b7e391ae99a9181f3c7a1eaaeee3c1932535
parent278ef381ed7f89bc09348229972113a7d5a2be81 (diff)
downloadklibc-ab3ef87cfcc9d01d2cb7110408b7dfc81c3ffa8d.tar.gz
fstype: Fix reversed test for "-" on command lineklibc-1.4.31
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>
-rw-r--r--usr/kinit/fstype/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr/kinit/fstype/main.c b/usr/kinit/fstype/main.c
index 7c81f24b06e96..0ceb593c778f4 100644
--- a/usr/kinit/fstype/main.c
+++ b/usr/kinit/fstype/main.c
@@ -37,7 +37,7 @@ int main(int argc, char *argv[])
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]);