This fixes a regression from aa62bb1 that caused trurl to abort successfully at the first empty (but not blank) line instead of simply skipping it.
This patch also makes trurl skip too long lines instead of successfully aborting when encountering one.
It also avoids calling fgets() after EOF, and reports read errors caused by getc()/fgets() if any.
I added a testfiles/ directory in which to add --url-file files to use in tests, and some tests that check that empty lines are ignored, long lines are reported and skipped, and spaces and tabs, and final carriage return are trimmed off the end lines.
This fixes a regression from aa62bb1 that caused trurl to abort successfully at the first empty (but not blank) line instead of simply skipping it.
This patch also makes trurl skip too long lines instead of successfully aborting when encountering one.
It also avoids calling fgets() after EOF, and reports read errors caused by getc()/fgets() if any.
I added a testfiles/ directory in which to add --url-file files to use in tests, and some tests that check that empty lines are ignored, long lines are reported and skipped, and spaces and tabs, and final carriage return are trimmed off the end lines.