daveewart / colordiff

Primary development for colordiff
http://www.colordiff.org/
GNU General Public License v2.0
177 stars 37 forks source link

Fix empty output when --difftype is given; warn for invalid --difftype #23

Closed Lekensteyn closed 9 years ago

Lekensteyn commented 9 years ago

Patch 1: After

commit 384eea619ec366f610d6c8070da724a7de69f1df
Author: Peter Wu <lekensteyn@gmail.com>
Date:   Sat Feb 23 00:55:27 2013 +0100

    Avoid reading input again if it was closed

the input would not be consumed anymore whenever --difftype was specified for values other than 'diffy'. This happened because $lastline is not initialized and the script thinks that it is EOF (and therefore stops reading more data).

Fixes https://github.com/daveewart/colordiff/issues/22


Patch 2 adds validation of --difftype and prints a warning to stderr for invalid values.

daveewart commented 9 years ago

Thanks for the fix, that's great :-)