diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-02-03 09:27:58 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-03 09:27:58 -0500 |
commit | 5e7d6e52dd8ac8f7e213cde7b98f270c77608523 (patch) | |
tree | cfc80de469cb835c603339f8eb5f6ddd035e2958 /vendor/github.com/mattn/go-shellwords | |
parent | 227d8815806fe63d07433707a356eb2e8c011f1e (diff) | |
parent | 94453c85c78908096764f8c0cb4cf72a470c182b (diff) | |
download | podman-5e7d6e52dd8ac8f7e213cde7b98f270c77608523.tar.gz podman-5e7d6e52dd8ac8f7e213cde7b98f270c77608523.tar.bz2 podman-5e7d6e52dd8ac8f7e213cde7b98f270c77608523.zip |
Merge pull request #5053 from containers/dependabot/go_modules/github.com/containers/storage-1.15.8
build(deps): bump github.com/containers/storage from 1.15.7 to 1.15.8
Diffstat (limited to 'vendor/github.com/mattn/go-shellwords')
-rw-r--r-- | vendor/github.com/mattn/go-shellwords/go.mod | 2 | ||||
-rw-r--r-- | vendor/github.com/mattn/go-shellwords/shellwords.go | 28 |
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 { |