fix: setdefaults & input of EOF

This commit is contained in:
Renge 2022-03-03 17:43:40 -05:00
parent fceb33dbc1
commit 8d471113ce

View File

@ -235,7 +235,7 @@ static void setdefaults(
start = *inlines;
for (end = start; *end; ++end);
for (line = inlines + 1; *line; ++line) {
for (p2 = *line; *p2; ++p2)
for (p2 = *line; *p2; ++p2);
for (p1 = end;
p1 > start && p2 > *line && p1[-1] == p2[-1];
--p1, --p2);
@ -297,6 +297,7 @@ int original_main(int argc, const char * const *argv)
for (;;) {
for (;;) {
c = getchar();
if (c == EOF) goto parcleanup;
if (c != '\n') break;
putchar(c);
}