summaryrefslogtreecommitdiffstats
path: root/tests/langbench/grep.tcl
blob: c2ad946be0370d2aa44b0ea36b57edacd8bfe19a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
proc grep {file} {
	set f [open $file rb]
	set buf ""
	while {[gets $f buf] >= 0} {
		if {[regexp -- {[^A-Za-z]fopen\(.*\)} $buf]} { puts $buf }
	}
	close $f
}
fconfigure stdout -translation binary 
foreach file $argv {
	grep $file
}