aboutsummaryrefslogtreecommitdiff
path: root/dist/isum.awk
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2008-12-06 15:45:15 -0800
committerRuss Cox <rsc@swtch.com>2008-12-06 15:45:15 -0800
commit7c8e7ef4c47b40ab9996fe98d72341cde0b5ab40 (patch)
tree548610a37d8af1083536a6e4674a640cc5fe0634 /dist/isum.awk
parent1a22c43f78a9accbcfcffca1b0e3718e4d90e869 (diff)
downloadplan9port-7c8e7ef4c47b40ab9996fe98d72341cde0b5ab40.tar.gz
plan9port-7c8e7ef4c47b40ab9996fe98d72341cde0b5ab40.tar.bz2
plan9port-7c8e7ef4c47b40ab9996fe98d72341cde0b5ab40.zip
isum.awk: make flush work everywhere else again
Diffstat (limited to 'dist/isum.awk')
-rw-r--r--dist/isum.awk27
1 files changed, 14 insertions, 13 deletions
diff --git a/dist/isum.awk b/dist/isum.awk
index cb475cde..7f774561 100644
--- a/dist/isum.awk
+++ b/dist/isum.awk
@@ -10,8 +10,9 @@ BEGIN {
updates = "/dev/stderr"
}
-function fflush(filename)
+function myflush(f)
{
+ # fflush is not available on sun, but system("") appears to work everywhere
system("")
}
@@ -23,7 +24,7 @@ function clearstatus(noflush, i)
printf("\b \b") >updates
statuslen = 0
if(!noflush)
- fflush(updates)
+ myflush(updates)
}
function status(s)
@@ -33,7 +34,7 @@ function status(s)
clearstatus(1)
printf(" %s ", s) >updates
statuslen = length(s)+5
- fflush(updates)
+ myflush(updates)
}
debug!=0 { print "# " $0 }
@@ -47,10 +48,10 @@ debug!=0 { print "# " $0 }
clearstatus()
if(debug) print "% mark"
print >out
- fflush(out)
+ myflush(out)
if(copy){
print >copy
- fflush(copy)
+ myflush(copy)
}
cmd = ""
printtabs = 1 # print indented lines immediately following
@@ -61,10 +62,10 @@ debug!=0 { print "# " $0 }
/^ / && printtabs!=0 {
clearstatus()
print >out
- fflush(out)
+ myflush(out)
if(copy){
print >copy
- fflush(copy)
+ myflush(copy)
}
next
}
@@ -92,10 +93,10 @@ debug!=0 { print "# " $0 }
errors = 0
if(verbose){
print >out
- fflush(out)
+ myflush(out)
if(copy){
print >copy
- fflush(copy)
+ myflush(copy)
}
}
cd = $0 "\n"
@@ -111,10 +112,10 @@ errors != 0 {
clearstatus()
if(debug) print "% errors"
printf "%s", cmd >out
- fflush(out)
+ myflush(out)
if(copy){
printf "%s", cmd >copy
- fflush(copy)
+ myflush(copy)
}
cmd = ""
next
@@ -144,10 +145,10 @@ errors != 0 {
if(debug) print "% errors1"
errors = 1
printf ">>> %s", cmd >out
- fflush(out)
+ myflush(out)
if(copy){
printf ">>> %s", cmd >copy
- fflush(copy)
+ myflush(copy)
}
cmd = ""
}