summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Fankhauser hiddenalpha.ch2026-03-02 01:44:58 +0100
committerAndreas Fankhauser hiddenalpha.ch2026-03-02 01:44:58 +0100
commitfc355ee88235a718f2e5f87acaae62ff08589f2f (patch)
treeb4864fb826538884a291cbda5cb48e071c9348ce
parent9eb0f859ad53cadec82144c2cda57205e77b4682 (diff)
downloadquotprint-fc355ee88235a718f2e5f87acaae62ff08589f2f.tar.gz
quotprint-fc355ee88235a718f2e5f87acaae62ff08589f2f.zip
Some cosmetic. Plus make encode if no args given
-rwxr-xr-xconfigure2
-rw-r--r--src/quotprint.c9
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;
}