line_length -= line[line_length - 1] == '\n';
/* Remove any trailing carriage return. */
line_length -= line[line_length - (0 < line_length)] == '\r';
+
+ /* Ignore empty lines. */
+ if (line_length == 0)
+ continue;
+
line[line_length] = '\0';
if (! (split_3 (line, line_length, &hex_digest, &binary, &filename)
{IN=> {'f.md5' => "$degenerate f\r\n"}},
{OUT=>"f: OK\n"}],
- # Same as above, but with an added empty line, to provoke --strict.
+ # Same as above, but with an added empty line, to test --strict.
['ck-strict-1', '--check --strict', {AUX=> {f=> ''}},
{IN=> {'f.md5' => "$degenerate f\n\n"}},
- {OUT=>"f: OK\n"},
- {ERR=>"md5sum: "
- . "WARNING: 1 line is improperly formatted\n"},
- {EXIT=> 1}],
+ {OUT=>"f: OK\n"}],
# As above, but with the invalid line first, to ensure that following
# lines are processed in spite of the preceding invalid input line.
['ck-strict-2', '--check --strict', {AUX=> {f=> ''}},
- {IN=> {'in.md5' => "\n$degenerate f\n"}},
+ {IN=> {'in.md5' => "ERR\n$degenerate f\n"}},
{OUT=>"f: OK\n"},
{ERR=>"md5sum: "
. "WARNING: 1 line is improperly formatted\n"},