From 521a29446f1bdcc3989301cd5ff8dbced0315630 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sat, 18 Jan 2020 00:27:00 -0600 Subject: [PATCH] Don't rely on obscure printf features. They may not work on all platforms. --- src/mainclient/line.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mainclient/line.c b/src/mainclient/line.c index 09d1f24f..8b0c5168 100644 --- a/src/mainclient/line.c +++ b/src/mainclient/line.c @@ -487,11 +487,16 @@ static void kshowcomp(void) { if (cols == 0) cols = 1; int current_col = 0; for (int i = 0; i < gbl_match_count; i++) { - if (current_col == 0) printf("\n"); - printf("%-*s", col_width, (const char *) gbl_matches[i].bytes); + if (current_col == 0) putc('\n', stdout); + JanetByteView s = gbl_matches[i]; + printf("%s", (const char *) s.bytes); + for (int j = s.len; j < col_width; j++) { + putc(' ', stdout); + } current_col = (current_col + 1) % cols; } - printf("\n"); + putc('\n', stdout); + fflush(stdout); rawmode(); }