curl / trurl

a command line tool for URL parsing and manipulation.
https://curl.se/trurl/
Other
3.19k stars 100 forks source link

--url-file: skip long and empty lines instead of successfully aborting #197

Closed emanuele6 closed 1 year ago

emanuele6 commented 1 year ago

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.

bagder commented 1 year ago

tests.json conflicts now though, do you mind fixing that?

emanuele6 commented 1 year ago

Done

emanuele6 commented 1 year ago

I resolved the merge conflict and rebased on master.

emanuele6 commented 1 year ago

The commit had the wrong message for some reason :/