changeset e0f3287fc680 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=e0f3287fc680
description:
        rundiff: Don't flush stdout until after postcontext is printed.

diffstat:

1 file changed, 8 insertions(+), 2 deletions(-)
util/rundiff |   10 ++++++++--

diffs (30 lines):

diff -r 8b5bc1a777bc -r e0f3287fc680 util/rundiff
--- a/util/rundiff      Sat Sep 26 10:50:50 2009 -0700
+++ b/util/rundiff      Sat Sep 26 10:50:50 2009 -0700
@@ -166,7 +166,11 @@
     # 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 @@
        # 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
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to