summaryrefslogtreecommitdiff
path: root/vendor/github.com/mattn/go-shellwords
diff options
context:
space:
mode:
authordependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>2020-02-03 09:16:41 +0000
committerValentin Rothberg <rothberg@redhat.com>2020-02-03 13:51:31 +0100
commit94453c85c78908096764f8c0cb4cf72a470c182b (patch)
tree969f0921dedcdbc8c56a80e6679fbd70c3854aa4 /vendor/github.com/mattn/go-shellwords
parent4699d5e02d3270b5cc89f7528b53b823fbf88796 (diff)
downloadpodman-94453c85c78908096764f8c0cb4cf72a470c182b.tar.gz
podman-94453c85c78908096764f8c0cb4cf72a470c182b.tar.bz2
podman-94453c85c78908096764f8c0cb4cf72a470c182b.zip
build(deps): bump github.com/containers/storage from 1.15.7 to 1.15.8
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.15.7 to 1.15.8. - [Release notes](https://github.com/containers/storage/releases) - [Changelog](https://github.com/containers/storage/blob/master/docs/containers-storage-changes.md) - [Commits](https://github.com/containers/storage/compare/v1.15.7...v1.15.8) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/github.com/mattn/go-shellwords')
-rw-r--r--vendor/github.com/mattn/go-shellwords/go.mod2
-rw-r--r--vendor/github.com/mattn/go-shellwords/shellwords.go28
2 files changed, 24 insertions, 6 deletions
diff --git a/vendor/github.com/mattn/go-shellwords/go.mod b/vendor/github.com/mattn/go-shellwords/go.mod
index 8d96dbd5f..927c8c7d6 100644
--- a/vendor/github.com/mattn/go-shellwords/go.mod
+++ b/vendor/github.com/mattn/go-shellwords/go.mod
@@ -1 +1,3 @@
module github.com/mattn/go-shellwords
+
+go 1.13
diff --git a/vendor/github.com/mattn/go-shellwords/shellwords.go b/vendor/github.com/mattn/go-shellwords/shellwords.go
index ff5e73091..ef080861a 100644
--- a/vendor/github.com/mattn/go-shellwords/shellwords.go
+++ b/vendor/github.com/mattn/go-shellwords/shellwords.go
@@ -88,9 +88,17 @@ loop:
backtick += string(r)
} else if got {
if p.ParseEnv {
- buf = replaceEnv(p.Getenv, buf)
+ parser := &Parser{ParseEnv: false, ParseBacktick: false, Position: 0, Dir: p.Dir}
+ strs, err := parser.Parse(replaceEnv(p.Getenv, buf))
+ if err != nil {
+ return nil, err
+ }
+ for _, str := range strs {
+ args = append(args, str)
+ }
+ } else {
+ args = append(args, buf)
}
- args = append(args, buf)
buf = ""
got = false
}
@@ -144,7 +152,7 @@ loop:
}
case '"':
if !singleQuoted && !dollarQuote {
- if doubleQuoted && buf == "" {
+ if doubleQuoted {
got = true
}
doubleQuoted = !doubleQuoted
@@ -152,7 +160,7 @@ loop:
}
case '\'':
if !doubleQuoted && !dollarQuote {
- if singleQuoted && buf == "" {
+ if singleQuoted {
got = true
}
singleQuoted = !singleQuoted
@@ -180,9 +188,17 @@ loop:
if got {
if p.ParseEnv {
- buf = replaceEnv(p.Getenv, buf)
+ parser := &Parser{ParseEnv: false, ParseBacktick: false, Position: 0, Dir: p.Dir}
+ strs, err := parser.Parse(replaceEnv(p.Getenv, buf))
+ if err != nil {
+ return nil, err
+ }
+ for _, str := range strs {
+ args = append(args, str)
+ }
+ } else {
+ args = append(args, buf)
}
- args = append(args, buf)
}
if escaped || singleQuoted || doubleQuoted || backQuote || dollarQuote {