If $WORK happens to contain the string that a stdout/stderr/grep
command is searching for, a negative grep command will fail incorrectly.
Fixes #27170
Fixes #27221
Change-Id: I84454d3c42360fe3295c7235d388381525eb85b4
Reviewed-on: https://go-review.googlesource.com/131398
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
(cherry picked from commit
e3106b455b74c91db94e8e1abf2342b5b5aec7b1)
Reviewed-on: https://go-review.googlesource.com/131399
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
text = string(data)
}
+ // Matching against workdir would be misleading.
+ text = strings.Replace(text, ts.workdir, "$WORK", -1)
+
if neg {
if re.MatchString(text) {
if isGrep {