xref: /aosp_15_r20/external/one-true-awk/testdir/t.index (revision 9a7741de182b2776d7b30d6355f2585c0780a51b)
1*9a7741deSElliott Hughes{	n = length
2*9a7741deSElliott Hughes	d = 0
3*9a7741deSElliott Hughes	for (i = 1; i <= n; i++)
4*9a7741deSElliott Hughes		if ((k = index($0, substr($0, i))) != i) {
5*9a7741deSElliott Hughes			d = 1
6*9a7741deSElliott Hughes			break;
7*9a7741deSElliott Hughes		}
8*9a7741deSElliott Hughes	if (d)
9*9a7741deSElliott Hughes		print $0, "has duplicate letters"
10*9a7741deSElliott Hughes}
11