Replace *Escape with *EscapeList
Follow the change to blueprint to make *Escape take and return a string
and add *EscapeList that take and return slices of strings. Fix up
a few places that were unnecessarily converting a string to a slice
and back to a string.
Test: m nothing
Change-Id: I3fa87de175522205f36544ef76aa2f04aef1b936
diff --git a/cc/compiler.go b/cc/compiler.go
index 0aee0bd..53a60c7 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -269,7 +269,7 @@
CheckBadCompilerFlags(ctx, "vendor.cflags", compiler.Properties.Target.Vendor.Cflags)
CheckBadCompilerFlags(ctx, "recovery.cflags", compiler.Properties.Target.Recovery.Cflags)
- esc := proptools.NinjaAndShellEscape
+ esc := proptools.NinjaAndShellEscapeList
flags.CFlags = append(flags.CFlags, esc(compiler.Properties.Cflags)...)
flags.CppFlags = append(flags.CppFlags, esc(compiler.Properties.Cppflags)...)
diff --git a/cc/linker.go b/cc/linker.go
index 25aedd0..9d4a0e8 100644
--- a/cc/linker.go
+++ b/cc/linker.go
@@ -392,7 +392,7 @@
CheckBadLinkerFlags(ctx, "ldflags", linker.Properties.Ldflags)
- flags.LdFlags = append(flags.LdFlags, proptools.NinjaAndShellEscape(linker.Properties.Ldflags)...)
+ flags.LdFlags = append(flags.LdFlags, proptools.NinjaAndShellEscapeList(linker.Properties.Ldflags)...)
if ctx.Host() {
rpath_prefix := `\$$ORIGIN/`
diff --git a/cc/tidy.go b/cc/tidy.go
index 6bac846..0b78d6f 100644
--- a/cc/tidy.go
+++ b/cc/tidy.go
@@ -69,7 +69,7 @@
if len(withTidyFlags) > 0 {
flags.TidyFlags = append(flags.TidyFlags, withTidyFlags)
}
- esc := proptools.NinjaAndShellEscape
+ esc := proptools.NinjaAndShellEscapeList
flags.TidyFlags = append(flags.TidyFlags, esc(tidy.Properties.Tidy_flags)...)
// If TidyFlags is empty, add default header filter.
if len(flags.TidyFlags) == 0 {