From aa03f0153032878b769b89c6822e89e2526dd465 Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Tue, 23 Apr 2013 08:07:51 +0200 Subject: [PATCH] actions: detachsign stdin/stdout support --- src/actions.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/actions.cpp b/src/actions.cpp index 7835211..1a7d7c3 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -303,7 +303,8 @@ int action_sign (const std::string&user, bool armor, const std::string&detach, std::ofstream detf; if (detach.length() ) { - detf.open (detach.c_str(), std::ios::out | std::ios::binary); + detf.open (detach == "-" ? "/dev/stdout" : detach.c_str(), + std::ios::out | std::ios::binary); if (!detf) { err ("error: can't open detached signature file"); return 1; @@ -427,7 +428,8 @@ int action_verify (bool armor, const std::string&detach, std::ifstream detf; if (detach.length() ) { - detf.open (detach.c_str(), std::ios::in | std::ios::binary); + detf.open (detach == "-" ? "/dev/stdin" : detach.c_str(), + std::ios::in | std::ios::binary); if (!detf) { err ("error: can't open detached signature file"); return 1;