Skip to content

Commit

Permalink
diag: Shell-escape expression arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
tavianator committed Jul 6, 2023
1 parent 58a3627 commit 66264f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/color.c
Original file line number Diff line number Diff line change
Expand Up @@ -1102,17 +1102,17 @@ static int print_expr(CFILE *cfile, const struct bfs_expr *expr, bool verbose) {
lhs = expr->lhs;
rhs = expr->rhs;

if (cbuff(cfile, "${red}%s${rs}", expr->argv[0]) < 0) {
if (cbuff(cfile, "${red}%pq${rs}", expr->argv[0]) < 0) {
return -1;
}
} else {
if (cbuff(cfile, "${blu}%s${rs}", expr->argv[0]) < 0) {
if (cbuff(cfile, "${blu}%pq${rs}", expr->argv[0]) < 0) {
return -1;
}
}

for (size_t i = 1; i < expr->argc; ++i) {
if (cbuff(cfile, " ${bld}%s${rs}", expr->argv[i]) < 0) {
if (cbuff(cfile, " ${bld}%pq${rs}", expr->argv[i]) < 0) {
return -1;
}
}
Expand Down

0 comments on commit 66264f1

Please sign in to comment.