From ce74a59bb2293a62a94e3fd6d426d70b05615f1b Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Thu, 7 Dec 2023 14:58:45 -0800 Subject: [PATCH] individually escape results of $(locations) proptools.ShellEscape escapes mostly by surrounding the string in quotes. This makes all the files from a $(locations) be passed as one shell argument if escaping was needed. Escape them individually so that they're still passed as separate arguments. Bug: 307824623 Test: running art tests with aosp/2860435 Change-Id: I9940941f4a7bb4d29d9388e4d57f8cbd732b6d32 --- genrule/genrule.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genrule/genrule.go b/genrule/genrule.go index 6b1101906..4db4e8654 100644 --- a/genrule/genrule.go +++ b/genrule/genrule.go @@ -539,7 +539,7 @@ func (g *Module) generateCommonBuildActions(ctx android.ModuleContext) { if len(paths) == 0 { return reportError("label %q has no files", label) } - return proptools.ShellEscape(strings.Join(paths, " ")), nil + return strings.Join(proptools.ShellEscapeList(paths), " "), nil } else { return reportError("unknown locations label %q is not in srcs, out, tools or tool_files.", label) }