1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Fix panic when ENV ARG=ARG is used.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
This commit is contained in:
Erik Hollensbe 2014-08-31 05:39:36 -07:00
parent 280b64bc7b
commit a0255ba502
2 changed files with 9 additions and 0 deletions

View file

@ -9,6 +9,7 @@ package parser
import (
"encoding/json"
"errors"
"fmt"
"strconv"
"strings"
)
@ -43,6 +44,11 @@ func parseEnv(rest string) (*Node, map[string]bool, error) {
node := &Node{}
rootnode := node
strs := TOKEN_WHITESPACE.Split(rest, 2)
if len(strs) < 2 {
return nil, nil, fmt.Errorf("ENV must have two arguments")
}
node.Value = strs[0]
node.Next = &Node{}
node.Next.Value = strs[1]

View file

@ -0,0 +1,3 @@
FROM busybox
ENV PATH=PATH