git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Makefile: escape ' in bin-wrappers rule

From
Devin Lehmacher <lehmacdj@gmail.com>
Date
Mar 16, 2017, 06:17 UTC
Message-ID
<20170316061738.26760-1-lehmacdj@gmail.com>
If the pwd contains a ' escape it as '\'' so that git will not fail
while building on a path containing '.
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index ed68700ac..5cf5d8537 100644
--- a/Makefile
+++ b/Makefile
@@ -2276,7 +2276,7 @@ all:: $(NO_INSTALL)
 bin-wrappers/%: wrap-for-bin.sh
 	@mkdir -p bin-wrappers
 	$(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-	     -e 's|@@BUILD_DIR@@|$(shell pwd)|' \
+	     -e 's|@@BUILD_DIR@@|$(shell pwd | sed -e "s/'/'\\\''/g")|' \
 	     -e 's|@@PROG@@|$(patsubst test-%,t/helper/test-%,$(@F))|' < $< > $@ && \
 	chmod +x $@
 
-- 
2.11.0
Next: Jeff King
Message 1 of 2 in “Makefile: escape ' in bin-wrappers rule”
  1. Makefile: escape ' in bin-wrappers ruleDevin Lehmacher, Mar 16, 2017
  2. Jeff KingMar 16, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.