Index: devel/rlwrap/Makefile =================================================================== --- devel/rlwrap/Makefile +++ devel/rlwrap/Makefile @@ -2,6 +2,7 @@ PORTNAME= rlwrap DISTVERSION= 0.44 +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= https://github.com/hanslub42/rlwrap/releases/download/${DISTVERSION}/ Index: devel/rlwrap/files/patch-src_filter.c =================================================================== --- /dev/null +++ devel/rlwrap/files/patch-src_filter.c @@ -0,0 +1,14 @@ +--- src/filter.c.orig 2021-01-19 09:56:05 UTC ++++ src/filter.c +@@ -107,7 +107,10 @@ void spawn_filter(const char *filter_command) { + char **argv; + + i_am_filter = TRUE; +- my_fopen(&debug_fp, DEBUG_FILENAME, "a+", "debug log"); ++#ifdef DEBUG ++ if (debug) ++ my_fopen(&debug_fp, DEBUG_FILENAME, "a+", "debug log"); ++#endif + unblock_signals(signals_to_allow); /* when we run a pager from a filter we want to catch these */ + + Index: devel/rlwrap/files/patch-src_pty.c =================================================================== --- /dev/null +++ devel/rlwrap/files/patch-src_pty.c @@ -0,0 +1,14 @@ +--- src/pty.c.orig 2021-01-19 09:56:05 UTC ++++ src/pty.c +@@ -58,7 +58,10 @@ my_pty_fork(int *ptr_master_fd, + } else if (pid == 0) { /* child */ + DEBUG_RANDOM_SLEEP; + i_am_child = TRUE; /* remember who I am */ +- my_fopen(&debug_fp, DEBUG_FILENAME, "a+", "debug log"); ++#ifdef DEBUG ++ if (debug) ++ my_fopen(&debug_fp, DEBUG_FILENAME, "a+", "debug log"); ++#endif + + unblock_all_signals(); + close(fdm); /* fdm not used in child */ Index: devel/rlwrap/files/patch-src_term.c =================================================================== --- /dev/null +++ devel/rlwrap/files/patch-src_term.c @@ -0,0 +1,15 @@ +--- src/term.c.orig 2021-06-14 21:52:54 UTC ++++ src/term.c +@@ -357,10 +357,12 @@ static void cursor_hpos4 () { cursor_hpos(4);} + + void test_terminal() + { ++#ifdef DEBUG + if (debug) { + debug_fp = fopen(DEBUG_FILENAME, "w"); + setbuf(debug_fp, NULL); + } ++#endif + init_terminal(); + printf("\nTerminal is \"%s\"\n", term_name); + test_termfunc(term_backspace, "term_backspace", "This should print \"grape\": \ngras", &backspace1, "pe\n"); Index: devel/rlwrap/files/patch-src_utils.c =================================================================== --- /dev/null +++ devel/rlwrap/files/patch-src_utils.c @@ -0,0 +1,13 @@ +--- src/utils.c.orig 2021-06-14 21:53:34 UTC ++++ src/utils.c +@@ -465,8 +465,10 @@ close_open_files_without_writing_buffers() /* called f + { + if(log_fp) + close(fileno(log_fp)); /* don't flush buffers to avoid avoid double double output output */ ++#ifdef DEBUG + if (debug) + close(fileno(debug_fp)); ++#endif + } + +