Skip to content

Commit

Permalink
ren: handle traps when a diversion is being output
Browse files Browse the repository at this point in the history
Reported and tested by Dirk-Wilhelm Peters <[email protected]>.
  • Loading branch information
aligrudi committed Nov 8, 2023
1 parent f6e2ba9 commit 25cfe2f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ren.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,9 @@ void tr_popren(char **args)
/* read characters from tr.c and pass the rendered lines to out.c */
static int render_rec(int level)
{
int ren_div_saved = ren_div;
int c;
ren_div = 0;
while (ren_level >= level) {
while (!ren_un && !tr_nextreq())
if (ren_level < level)
Expand Down Expand Up @@ -1079,6 +1081,8 @@ static int render_rec(int level)
if (c >= 0)
ren_nl = c == '\n';
}
/* restore ren_div after processing traps */
ren_div = ren_div_saved;
return 0;
}

Expand Down

0 comments on commit 25cfe2f

Please sign in to comment.