From 1cefa2be99d9419bbd250ffa1cac173a9433c712 Mon Sep 17 00:00:00 2001 From: Seppe Soete Date: Tue, 25 Aug 2020 18:07:02 +0200 Subject: [PATCH] allow a custom formatting to not have a newline in the end --- main.c | 4 ++-- slurp.1.scd | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 47b6314..7066bf0 100644 --- a/main.c +++ b/main.c @@ -686,7 +686,7 @@ static void print_formatted_result(const struct slurp_box *result, } printf("%c", c); } - printf("\n"); + fflush(stdout); } static void add_choice_box(struct slurp_state *state, @@ -712,7 +712,7 @@ int main(int argc, char *argv[]) { }; int opt; - char *format = "%x,%y %wx%h"; + char *format = "%x,%y %wx%h\n"; while ((opt = getopt(argc, argv, "hdb:c:s:w:pf:")) != -1) { switch (opt) { case 'h': diff --git a/slurp.1.scd b/slurp.1.scd index 9a5e5f6..358ad28 100644 --- a/slurp.1.scd +++ b/slurp.1.scd @@ -68,7 +68,7 @@ Interpreted sequences are: %l Label included with region from stdin -The default format is "%x,%y %wx%h". +The default format is "%x,%y %wx%h\\n". # AUTHORS