From fc355ee88235a718f2e5f87acaae62ff08589f2f Mon Sep 17 00:00:00 2001 From: Andreas Fankhauser hiddenalpha.ch Date: Mon, 2 Mar 2026 01:44:58 +0100 Subject: Some cosmetic. Plus make encode if no args given --- configure | 2 +- src/quotprint.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 06e4c1e..645c7b2 100755 --- a/configure +++ b/configure @@ -24,7 +24,7 @@ MKDIRS=mkdir -p RIMRAF=rm -rf PROJECT_NAME=quotprint -PROJECT_VERSION=$(shell git describe --tags || date -u +0.0.0-%Y%m%d.%H%M%S) +PROJECT_VERSION=$(shell git describe --tags|sed -E 's;^v;;' || date -u +0.0.0-%Y%m%d.%H%M%S) CFLAGS=]=])for _, f in ipairs(getCFLAGSArr())do snk:write(" ")snk:write(f)end snk:write([=[ \ -DPROJECT_NAME=$(PROJECT_NAME) \ diff --git a/src/quotprint.c b/src/quotprint.c index dbb06cc..683ea4f 100644 --- a/src/quotprint.c +++ b/src/quotprint.c @@ -89,10 +89,8 @@ PRIVATE(char) endOfFile; INLINE(void) printHelp( void ){ printf("\n" - " quotprint - QuotedPrintable codec\n" - " Version: " STR_QUOT(PROJECT_VERSION) "\n" + " quotprint " STR_QUOT(PROJECT_VERSION) "\n" " \n" - " About the quoted-printable encoding see:\n" " https://www.rfc-editor.org/rfc/rfc2045#section-6.7\n" " \n" " -e `encode` to QuotedPrintable\n" @@ -100,6 +98,8 @@ printHelp( void ){ " -b When given to `-e`, will encode `binary` safe. Eg newlines will\n" " be quoted always.\n" " \n" + " BUG: Bad decoding when trailing whitespaces present.\n" + " Fix: Make sure input does not have trailing whitespace.\n" "\n"); } @@ -139,8 +139,7 @@ nextArg: verify: err = FLG_isEnc | FLG_isDec; if( (this->flg & err) == err || (this->flg & err) == 0 ){ - fprintf(stderr, "EINVAL: Choose exactly ONE of `encode` XOR `decode`.\n"); - return -1; + this->flg |= FLG_isEnc|FLG_isBinary; /* fallback to encode */ } return 0; } -- cgit v1.3.1