summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2012-01-17 23:37:24 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2012-01-17 23:37:24 -0500
commit8eb861b248b1952f347f3535ce3f2396f6827a4c (patch)
tree805a2dfe3d0d43ec894c7886a59f0e54f1e8e383
parent6c0fc9ba5a02ec2ba507f43b79f0b12145f8b925 (diff)
Fix chardiff (goes neglected until it is needed)
-rw-r--r--chardiff.sh2
-rw-r--r--chardiff_post.c8
2 files changed, 3 insertions, 7 deletions
diff --git a/chardiff.sh b/chardiff.sh
index b6d7403..74c3b2e 100644
--- a/chardiff.sh
+++ b/chardiff.sh
@@ -10,6 +10,6 @@ chardiff_pre < "$file1" > "$tmp1"
tmp2=`mktemp`
chardiff_pre < "$file2" > "$tmp2"
-wdiff $@ "$tmp1" "$tmp2" | chardiff_post
+wdiff "$@" "$tmp1" "$tmp2" | chardiff_post
rm "$tmp1" "$tmp2"
diff --git a/chardiff_post.c b/chardiff_post.c
index 2145759..c7f543f 100644
--- a/chardiff_post.c
+++ b/chardiff_post.c
@@ -13,12 +13,8 @@ main (int argc, char* argv[]) {
case '\\': putchar('\\'); break;
default: putchar(c2); break;
}
- }
- char n = getchar();
- if (n != '\n') {
- printf(
- "%s: found other character when expecting newline: %c",
- argv[0], n);
+ } else if (c!='\n') {
+ putchar(c);
}
}
}