mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-24 11:41:58 +00:00
isum.awk: make flush work everywhere else again
This commit is contained in:
parent
1a22c43f78
commit
7c8e7ef4c4
1 changed files with 14 additions and 13 deletions
27
dist/isum.awk
vendored
27
dist/isum.awk
vendored
|
@ -10,8 +10,9 @@ BEGIN {
|
||||||
updates = "/dev/stderr"
|
updates = "/dev/stderr"
|
||||||
}
|
}
|
||||||
|
|
||||||
function fflush(filename)
|
function myflush(f)
|
||||||
{
|
{
|
||||||
|
# fflush is not available on sun, but system("") appears to work everywhere
|
||||||
system("")
|
system("")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +24,7 @@ function clearstatus(noflush, i)
|
||||||
printf("\b \b") >updates
|
printf("\b \b") >updates
|
||||||
statuslen = 0
|
statuslen = 0
|
||||||
if(!noflush)
|
if(!noflush)
|
||||||
fflush(updates)
|
myflush(updates)
|
||||||
}
|
}
|
||||||
|
|
||||||
function status(s)
|
function status(s)
|
||||||
|
@ -33,7 +34,7 @@ function status(s)
|
||||||
clearstatus(1)
|
clearstatus(1)
|
||||||
printf(" %s ", s) >updates
|
printf(" %s ", s) >updates
|
||||||
statuslen = length(s)+5
|
statuslen = length(s)+5
|
||||||
fflush(updates)
|
myflush(updates)
|
||||||
}
|
}
|
||||||
|
|
||||||
debug!=0 { print "# " $0 }
|
debug!=0 { print "# " $0 }
|
||||||
|
@ -47,10 +48,10 @@ debug!=0 { print "# " $0 }
|
||||||
clearstatus()
|
clearstatus()
|
||||||
if(debug) print "% mark"
|
if(debug) print "% mark"
|
||||||
print >out
|
print >out
|
||||||
fflush(out)
|
myflush(out)
|
||||||
if(copy){
|
if(copy){
|
||||||
print >copy
|
print >copy
|
||||||
fflush(copy)
|
myflush(copy)
|
||||||
}
|
}
|
||||||
cmd = ""
|
cmd = ""
|
||||||
printtabs = 1 # print indented lines immediately following
|
printtabs = 1 # print indented lines immediately following
|
||||||
|
@ -61,10 +62,10 @@ debug!=0 { print "# " $0 }
|
||||||
/^ / && printtabs!=0 {
|
/^ / && printtabs!=0 {
|
||||||
clearstatus()
|
clearstatus()
|
||||||
print >out
|
print >out
|
||||||
fflush(out)
|
myflush(out)
|
||||||
if(copy){
|
if(copy){
|
||||||
print >copy
|
print >copy
|
||||||
fflush(copy)
|
myflush(copy)
|
||||||
}
|
}
|
||||||
next
|
next
|
||||||
}
|
}
|
||||||
|
@ -92,10 +93,10 @@ debug!=0 { print "# " $0 }
|
||||||
errors = 0
|
errors = 0
|
||||||
if(verbose){
|
if(verbose){
|
||||||
print >out
|
print >out
|
||||||
fflush(out)
|
myflush(out)
|
||||||
if(copy){
|
if(copy){
|
||||||
print >copy
|
print >copy
|
||||||
fflush(copy)
|
myflush(copy)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cd = $0 "\n"
|
cd = $0 "\n"
|
||||||
|
@ -111,10 +112,10 @@ errors != 0 {
|
||||||
clearstatus()
|
clearstatus()
|
||||||
if(debug) print "% errors"
|
if(debug) print "% errors"
|
||||||
printf "%s", cmd >out
|
printf "%s", cmd >out
|
||||||
fflush(out)
|
myflush(out)
|
||||||
if(copy){
|
if(copy){
|
||||||
printf "%s", cmd >copy
|
printf "%s", cmd >copy
|
||||||
fflush(copy)
|
myflush(copy)
|
||||||
}
|
}
|
||||||
cmd = ""
|
cmd = ""
|
||||||
next
|
next
|
||||||
|
@ -144,10 +145,10 @@ errors != 0 {
|
||||||
if(debug) print "% errors1"
|
if(debug) print "% errors1"
|
||||||
errors = 1
|
errors = 1
|
||||||
printf ">>> %s", cmd >out
|
printf ">>> %s", cmd >out
|
||||||
fflush(out)
|
myflush(out)
|
||||||
if(copy){
|
if(copy){
|
||||||
printf ">>> %s", cmd >copy
|
printf ">>> %s", cmd >copy
|
||||||
fflush(copy)
|
myflush(copy)
|
||||||
}
|
}
|
||||||
cmd = ""
|
cmd = ""
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue