Files
Digital-Research-Source-Code/CPM OPERATING SYSTEMS/CPM 68K/cpm68k_pgms/utils/killdu.c
Sepp J Morris 31738079c4 Upload
Digital Research
2020-11-06 18:50:37 +01:00

1 line
638 B
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* -*-c,save-*- */
#include <stdio.h>
main()
{static char line1[128],line2[128];
register char *l1,*l2,*p;
register int which, c;
which = 0;
p = l1 = &line1[0];
l2 = &line2[0];
while ((c=getchar()) != EOF) {
if (c != '\n') *p++ = c;
else {
*p++ = '\0';
switch (which) {
case 0: {
printf("%s\n",l1);
p = l2;
l2 = l1;
l1 = p;
which = 1;
break;
}
case 1: {
if (strcmp(l1,l2) != 0) {
printf("%s\n",l1);
p = l2;
l2 = l1;
l1 = p;
}
else p = l1;
break;
}
}
}
}
}
eturn(cmp);
}