Variable expansion bug.

This commit is contained in:
Daniel Jones 2013-03-10 00:34:42 -08:00
parent 8cbbe9c53c
commit 587bdd6c63
8 changed files with 99 additions and 79 deletions

View file

@ -152,7 +152,7 @@ func subprocess(program string,
var outbytes []byte
outbytes, err = cmd.Output()
output = string(outbytes)
if output[len(output)-1] == '\n' {
if len(output) > 0 && output[len(output)-1] == '\n' {
output = output[:len(output)-1]
}
} else {