Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c217fdc authored by Colin Cross's avatar Colin Cross
Browse files

Fix WriteFileRule escaping

WriteFileRule shouldn't force the caller to ninja escape the input,
and should shell escape spaces.

Bug: 182612695
Test: manual
Change-Id: Ide2f1ed92783eef7883279238de209d992d8f735
parent b70a1a90
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@ var (

func buildWriteFileRule(ctx BuilderContext, outputFile WritablePath, content string) {
	content = echoEscaper.Replace(content)
	content = proptools.ShellEscape(content)
	content = proptools.NinjaEscape(proptools.ShellEscapeIncludingSpaces(content))
	if content == "" {
		content = "''"
	}
+1 −1
Original line number Diff line number Diff line
@@ -537,7 +537,7 @@ func (r *RuleBuilder) Build(name string, desc string) {
		}

		// Create a rule to write the manifest as a the textproto.
		WriteFileRule(r.ctx, r.sboxManifestPath, proptools.NinjaEscape(proto.MarshalTextString(&manifest)))
		WriteFileRule(r.ctx, r.sboxManifestPath, proto.MarshalTextString(&manifest))

		// Generate a new string to use as the command line of the sbox rule.  This uses
		// a RuleBuilderCommand as a convenience method of building the command line, then