From 148e6e3b7979fce87fc85c88816110b704dc1841 Mon Sep 17 00:00:00 2001 From: Evan Gates Date: Tue, 18 Nov 2014 13:41:52 -0800 Subject: [PATCH] read stdin if arg is exactly "-" not just begins with '-' --- cat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cat.c b/cat.c index a7842c8..fbf8069 100644 --- a/cat.c +++ b/cat.c @@ -30,7 +30,7 @@ main(int argc, char *argv[]) concat(stdin, "", stdout, ""); } else { for (; argc; argc--, argv++) { - if (argv[0][0] == '-') + if (argv[0][0] == '-' && !argv[0][1]) argv[0] = "/dev/fd/0"; if (!(fp = fopen(argv[0], "r"))) { weprintf("fopen %s:", argv[0]);