summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-09-07 14:24:12 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-09-07 14:24:12 -0400
commit23ebdbace364ffc2e27403e103594c12c0002b5b (patch)
treecec3757a4b34c8e6e9bc2296dcfa111ed89710cd
parent27a019af986edfcc9b50b3e322bdb7a25a41c205 (diff)
clean up chardiff
-rw-r--r--chardiff.sh10
-rw-r--r--chardiff_post.c5
-rw-r--r--chardiff_pre.c1
3 files changed, 2 insertions, 14 deletions
diff --git a/chardiff.sh b/chardiff.sh
index 74c3b2e..17234ae 100644
--- a/chardiff.sh
+++ b/chardiff.sh
@@ -4,12 +4,4 @@ file1=${1?usage: chardiff FILE1 FILE2 [FLAGS]}
file2=${2?usage: chardiff FILE1 FILE2 [FLAGS]}
shift 2
-tmp1=`mktemp`
-chardiff_pre < "$file1" > "$tmp1"
-
-tmp2=`mktemp`
-chardiff_pre < "$file2" > "$tmp2"
-
-wdiff "$@" "$tmp1" "$tmp2" | chardiff_post
-rm "$tmp1" "$tmp2"
-
+wdiff "$@" <(chardiff_pre < "$file1") <(chardiff_pre < "$file2") | chardiff_post
diff --git a/chardiff_post.c b/chardiff_post.c
index c7f543f..9a71eeb 100644
--- a/chardiff_post.c
+++ b/chardiff_post.c
@@ -1,7 +1,5 @@
#include <stdio.h>
-extern char* program_name;
-
int
main (int argc, char* argv[]) {
char c;
@@ -11,11 +9,10 @@ main (int argc, char* argv[]) {
switch (c2) {
case 'n': putchar('\n'); break;
case '\\': putchar('\\'); break;
- default: putchar(c2); break;
+ default: putchar(c2); break;
}
} else if (c!='\n') {
putchar(c);
}
}
}
-
diff --git a/chardiff_pre.c b/chardiff_pre.c
index 8a68d54..baf7835 100644
--- a/chardiff_pre.c
+++ b/chardiff_pre.c
@@ -11,4 +11,3 @@ main (int argc, char* argv[]) {
}
}
}
-