From b92aaf61663a04f8b33888594f4fd7a2dedbbf2a Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 22 Jan 2012 13:12:14 +0000 Subject: [PATCH] dsig.c: Accept `-' to mean stdin/stdout in arguments to `-f' and `-o'. --- dsig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dsig.c b/dsig.c index d09b675..9468054 100644 --- 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", -- 2.11.0