summaryrefslogtreecommitdiffstats
path: root/tests/langbench/sort.l
blob: f36c0e7f0f269e4312119667faac5e4b242a333c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
void
main(int ac, string av[])
{
	int	i;
	FILE	f;
	string	buf;
	string	l[];

	fconfigure("stdout", buffering: "full", translation: "binary");
	for (i = 1; i < ac; ++i) {
		f = open(av[i], "rb");
		while (gets(f, &buf) >= 0) {
			push(&l, buf);
		}
	}
	foreach (buf in sort(l)) {
		puts(buf);
	}
}