dsig.c: Accept `-' to mean stdin/stdout in arguments to `-f' and `-o'.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 22 Jan 2012 13:12:14 +0000 (13:12 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 22 Jan 2012 13:12:14 +0000 (13:12 +0000)
dsig.c

diff --git a/dsig.c b/dsig.c
index d09b675..9468054 100644 (file)
--- a/dsig.c
+++ b/dsig.c
@@ -768,14 +768,14 @@ static int sign(int argc, char *argv[])
 
   /* --- Open files --- */
 
-  if (!ifile)
+  if (!ifile || strcmp(ifile, "-") == 0)
     ifp = stdin;
   else if ((ifp = fopen(ifile, (f & f_raw) ? "rb" : "r")) == 0) {
     die(EXIT_FAILURE, "couldn't open input file `%s': %s",
        ifile, strerror(errno));
   }
 
-  if (!ofile)
+  if (!ofile || strcmp(ofile, "-") == 0)
     ofp = stdout;
   else if ((ofp = fopen(ofile, (f & f_bin) ? "wb" : "w")) == 0) {
     die(EXIT_FAILURE, "couldn't open output file `%s': %s",