Skip to content

Commit

Permalink
When using a filter, rlwrap would always create a (possibly empty) /t…
Browse files Browse the repository at this point in the history
…mp/rlwrap.debug
  • Loading branch information
hanslub42 committed Jun 15, 2021
1 parent 1631440 commit 0f0e1b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ void spawn_filter(const char *filter_command) {
char **argv;

i_am_filter = TRUE;
my_fopen(&debug_fp, DEBUG_FILENAME, "a+", "debug log");
if (debug)
my_fopen(&debug_fp, DEBUG_FILENAME, "a+", "debug log");
unblock_signals(signals_to_allow); /* when we run a pager from a filter we want to catch these */


Expand Down
2 changes: 2 additions & 0 deletions src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ void my_fopen(FILE **pfp, const char *path, const char *mode, const char *descr
myerror(FATAL|USE_ERRNO, "Cannot %s %s %s for %s", what, description, path, how);
}


void
open_logfile(const char *filename)
{
Expand All @@ -433,6 +434,7 @@ open_logfile(const char *filename)
fprintf(log_fp, "\n\n[rlwrap] %s\n", ctime(&now));
}


void
write_logfile(const char *str)
{
Expand Down

0 comments on commit 0f0e1b3

Please sign in to comment.