From e35d94243e0fbd999a084f752b39b1e27eb87756 Mon Sep 17 00:00:00 2001 From: Laan Tungir Date: Thu, 14 Aug 2025 11:38:58 -0400 Subject: [PATCH] Version v0.2.75 - Fixed decrypt mode to suppress startup messages for clean pipe operations --- otp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/otp.c b/otp.c index e6e1ec4..4f7fd9f 100644 --- a/otp.c +++ b/otp.c @@ -138,11 +138,16 @@ int main(int argc, char* argv[]) { // Check for piped input first (before any output) int is_pipe_mode = (argc == 1 && has_stdin_data()); + // Check for decrypt command with piped input + int is_decrypt_pipe = (argc == 2 && + (strcmp(argv[1], "decrypt") == 0 || strcmp(argv[1], "-d") == 0) && + has_stdin_data()); + // Check for OTP thumb drive on startup char otp_drive_path[512]; if (detect_otp_thumb_drive(otp_drive_path, sizeof(otp_drive_path))) { // Only show messages in interactive/command mode, not pipe mode - if (!is_pipe_mode) { + if (!is_pipe_mode && !is_decrypt_pipe) { printf("Detected OTP thumb drive: %s\n", otp_drive_path); printf("Using as default pads directory for this session.\n\n"); }