From 10471c0ee8943ac6f9529b12eb496fd97efb7092 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Fri, 15 Oct 2021 09:29:41 -0400 Subject: Disable line buffering * Check pattern against acronym string --- source/app.d | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/app.d b/source/app.d index 08cd3f4..9b3582c 100644 --- a/source/app.d +++ b/source/app.d @@ -16,6 +16,9 @@ import jdtalk.core; int main(string[] args) { + setvbuf(stdout.getFP(), null, _IONBF, 0); + setvbuf(stderr.getFP(), null, _IONBF, 0); + import std.getopt; long i = 0; long limit = 0; @@ -64,10 +67,10 @@ int main(string[] args) return 1; } - if (acronym) { + if (acronym !is null) { char result = 0; - if ((result = acronymSafe(dict, acronym)) > 0) { - stderr.writefln("No words start with: '%c'", result); + if ((result = acronymSafe(dict, acronym, pattern)) > 0) { + stderr.writefln("No words will have: '%c'", result); return 1; } } -- cgit