commit 148e6e3b7979fce87fc85c88816110b704dc1841
Author: Evan Gates <[email protected]>
Date:   Tue Nov 18 13:41:52 2014 -0800

    read stdin if arg is exactly "-" not just begins with '-'

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, "<stdin>", stdout, "<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]);


Reply via email to