summaryrefslogtreecommitdiff
path: root/util/rundiff
diff options
context:
space:
mode:
authorDerek Hower <drh5@cs.wisc.edu>2010-01-19 15:48:12 -0600
committerDerek Hower <drh5@cs.wisc.edu>2010-01-19 15:48:12 -0600
commit279f179babc9e5663156777c533c06edc91bce9a (patch)
treee6718ee514cc81678491b50562ce8c463c0b20fd /util/rundiff
parent5aa104e072eb20f6aca49b169521b0c2da33c844 (diff)
parent295516a590b6e47c9a881f193027447e500c749c (diff)
downloadgem5-279f179babc9e5663156777c533c06edc91bce9a.tar.xz
merge
Diffstat (limited to 'util/rundiff')
-rwxr-xr-xutil/rundiff10
1 files changed, 8 insertions, 2 deletions
diff --git a/util/rundiff b/util/rundiff
index cd2527e54..7e0a77057 100755
--- a/util/rundiff
+++ b/util/rundiff
@@ -166,7 +166,11 @@ sub printdiff
# Set $postcontext to print the next $postcontext_lines matching lines.
$postcontext = $postcontext_lines;
- STDOUT->flush();
+ # Normally we flush after the postcontext lines are printed, but if
+ # the user has decreed that there aren't any we need to flush now
+ if ($postcontext == 0) {
+ STDOUT->flush();
+ }
}
@@ -291,10 +295,12 @@ while (1) {
# figure out what to do with this line
if ($postcontext > 0) {
# we're in the post-context of a diff: print it
- $postcontext--;
print ' ', $l1;
$lineno1++;
$lineno2++;
+ if (--$postcontext == 0) {
+ STDOUT->flush();
+ }
}
else {
# we're in the middle of a matching region... save this