commit b454c47b530863e732c6100728d35e8e663d3a5d
parent 760c60d60ed363c83c22512e35a451544aaa44b7
Author: Quentin Rameau <quinq@fifth.space>
Date: Sat, 8 Mar 2025 19:03:55 +0100
mkdep: Fix backslash escapes
We need to escape the single backslash that we want to be printed,
otherwise ed will interpret it as an escape for the following newline:
Print target: $(fooOBJS)\␊
Passed to ed: $(fooOBJS)\\␊
From heredoc: $(fooOBJS)\\\\\n
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/libmach/mkdep b/src/libmach/mkdep
@@ -11,8 +11,9 @@ done`
/OBJS/a
`for i
do
- printf '\t$('$(echo $i | tr a-z A-Z)'OBJS)\\'
- echo
+ # Need to escape the single backlash to prevent ed
+ # from interperting it as escaping the newline
+ printf '\t$(%sOBJS)\\\\\\n' $(echo $i | tr a-z A-Z)
done`
.
w