Fix endless loop in "expandDoubleQuoted".

Fix an issue with expansion of escaped newlines.
Use the currently set mkfile vars as environment vars for the shell command invoked by "expandBackQuoted".
This commit is contained in:
DiablosOffens 2016-08-30 13:09:13 +02:00
parent 353e1eab5f
commit a3a923ffe8
3 changed files with 22 additions and 10 deletions

View file

@ -106,6 +106,7 @@ func dorecipe(target string, u *node, e *edge, dryrun bool) bool {
_, success := subprocess(
sh,
args,
nil,
input,
false)
@ -127,6 +128,7 @@ func dorecipe(target string, u *node, e *edge, dryrun bool) bool {
//
func subprocess(program string,
args []string,
env []string,
input string,
capture_out bool) (string, bool) {
program_path, err := exec.LookPath(program)
@ -142,7 +144,7 @@ func subprocess(program string,
log.Fatal(err)
}
attr := os.ProcAttr{Files: []*os.File{stdin_pipe_read, os.Stdout, os.Stderr}}
attr := os.ProcAttr{Env: env, Files: []*os.File{stdin_pipe_read, os.Stdout, os.Stderr}}
output := make([]byte, 0)
capture_done := make(chan bool)