aboutsummaryrefslogtreecommitdiffstats
path: root/cli/parser.go
diff options
context:
space:
mode:
authorPetter Rasmussen2016-01-23 10:57:13 +0100
committerPetter Rasmussen2016-01-23 10:57:13 +0100
commit4e0cf6011e0da8bbaa9b9b63ea347e4dc59b9ca3 (patch)
tree535428e764751b512cf6729c689d73b953678cfb /cli/parser.go
parent379c198883530b944c3b61d7b342bdad6d995163 (diff)
downloadgdrive-4e0cf6011e0da8bbaa9b9b63ea347e4dc59b9ca3.tar.bz2
Prevent mutation of input values
Diffstat (limited to 'cli/parser.go')
-rw-r--r--cli/parser.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/parser.go b/cli/parser.go
index 50bd0bd..5fbbe3f 100644
--- a/cli/parser.go
+++ b/cli/parser.go
@@ -330,7 +330,7 @@ func flagKeyValueMatch(key string, values []string, index int) ([]string, string
if values[index] == key {
value := values[index + 1]
- remaining := append(values[:index], values[index + 2:]...)
+ remaining := append(copySlice(values[:index]), values[index + 2:]...)
return remaining, value, true
}
@@ -343,7 +343,7 @@ func flagKeyMatch(key string, values []string, index int) ([]string, bool) {
}
if values[index] == key {
- remaining := append(values[:index], values[index + 1:]...)
+ remaining := append(copySlice(values[:index]), values[index + 1:]...)
return remaining, true
}