From f15add0abb0ad72fd8970b619dab3e3cfe2f053c Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sun, 22 Apr 2018 02:35:13 +0200 Subject: [PATCH 1/2] Don't dereference FILE* This is undefined behavour and doesn't work on musl --- src/grep_proc.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/grep_proc.cc b/src/grep_proc.cc index cba548e1..8e4fd50e 100644 --- a/src/grep_proc.cc +++ b/src/grep_proc.cc @@ -159,7 +159,6 @@ void grep_proc::child_loop(void) char outbuf[BUFSIZ * 2]; string line_value; - *stdout = *(fdopen(STDOUT_FILENO, "w")); /* Make sure buffering is on, not sure of the state in the parent. */ if (setvbuf(stdout, outbuf, _IOFBF, BUFSIZ * 2) < 0) { perror("setvbuf"); From 5594120f1a596fb6e312f8ab50d74321c61582c4 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Thu, 26 Apr 2018 14:48:17 +0200 Subject: [PATCH 2/2] Use CTRL macro from readline instead of CEOF from ttydefaults.h The ttydefaults.h header is not available on musl. Readline provides the same functionality with its CTRL macro and it makes the intent of the code a bit clearer (that we check for CTRL-D). --- src/lnav.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lnav.cc b/src/lnav.cc index 34d229ac..5c3cb288 100644 --- a/src/lnav.cc +++ b/src/lnav.cc @@ -1886,7 +1886,7 @@ static void handle_key(int ch) { } switch (ch) { - case CEOF: + case CTRL('d'): case KEY_RESIZE: break; default: @@ -2416,7 +2416,7 @@ static void looper(void) } switch (ch) { - case CEOF: + case CTRL('d'): case KEY_RESIZE: break;