cgmnlm

Unnamed repository; edit this file 'description' to name the repository.
git clone git://code.clttr.info/cgmnlm.git
Log | Files | Refs | README | LICENSE

commit 262ccc2005617eb633f5b3ba434ee26f8000e0a8
parent 2e593cd48bd5e1f90fcbb54b83955752cd392466
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sun, 20 Sep 2020 14:37:43 -0400

Suppress trailing newline if stdout is not a TTY

Diffstat:
Msrc/gmnic.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gmnic.c b/src/gmnic.c @@ -17,7 +17,7 @@ static void usage(char *argv_0) { fprintf(stderr, - "usage: %s [-LI] [-C cert] [-d input] gemini://...\n", + "usage: %s [-46lLiIN] [-C cert] [-d input] [-D path] gemini://...\n", argv_0); } @@ -209,7 +209,8 @@ main(int argc, char *argv[]) } } if (strncmp(resp.meta, "text/", 5) == 0 - && linefeed && last != '\n') { + && linefeed && last != '\n' + && isatty(STDOUT_FILENO)) { printf("\n"); } break;