summaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2010-04-26 14:01:14 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-04-26 14:01:14 +0200
commit0c1ba443c83553e85d39e26ae4bb126a2c58ce93 (patch)
tree440a233e20bbc7859389c5552c2e3d30dcf543fa /editors
parent4640ccc39940a4842c62a9c1cf91f425b3f0bc99 (diff)
downloadbusybox-w32-0c1ba443c83553e85d39e26ae4bb126a2c58ce93.tar.gz
busybox-w32-0c1ba443c83553e85d39e26ae4bb126a2c58ce93.tar.bz2
busybox-w32-0c1ba443c83553e85d39e26ae4bb126a2c58ce93.zip
cmp: ifdefectomy
Signed-off-by: Rob Landley <rob@landley.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'editors')
-rw-r--r--editors/cmp.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/editors/cmp.c b/editors/cmp.c
index 0cb80f21e..e8294510a 100644
--- a/editors/cmp.c
+++ b/editors/cmp.c
@@ -37,8 +37,7 @@ int cmp_main(int argc UNUSED_PARAM, char **argv)
37{ 37{
38 FILE *fp1, *fp2, *outfile = stdout; 38 FILE *fp1, *fp2, *outfile = stdout;
39 const char *filename1, *filename2 = "-"; 39 const char *filename1, *filename2 = "-";
40 IF_DESKTOP(off_t skip1 = 0, skip2 = 0;) 40 off_t skip1 = 0, skip2 = 0, char_pos = 0;
41 off_t char_pos = 0;
42 int line_pos = 1; /* Hopefully won't overflow... */ 41 int line_pos = 1; /* Hopefully won't overflow... */
43 const char *fmt; 42 const char *fmt;
44 int c1, c2; 43 int c1, c2;
@@ -59,14 +58,12 @@ int cmp_main(int argc UNUSED_PARAM, char **argv)
59 58
60 if (*++argv) { 59 if (*++argv) {
61 filename2 = *argv; 60 filename2 = *argv;
62#if ENABLE_DESKTOP 61 if (ENABLE_DESKTOP && *++argv) {
63 if (*++argv) {
64 skip1 = XATOOFF(*argv); 62 skip1 = XATOOFF(*argv);
65 if (*++argv) { 63 if (*++argv) {
66 skip2 = XATOOFF(*argv); 64 skip2 = XATOOFF(*argv);
67 } 65 }
68 } 66 }
69#endif
70 } 67 }
71 68
72 fp2 = xfopen_stdin(filename2); 69 fp2 = xfopen_stdin(filename2);
@@ -83,10 +80,10 @@ int cmp_main(int argc UNUSED_PARAM, char **argv)
83 else 80 else
84 fmt = fmt_differ; 81 fmt = fmt_differ;
85 82
86#if ENABLE_DESKTOP 83 if (ENABLE_DESKTOP) {
87 while (skip1) { getc(fp1); skip1--; } 84 while (skip1) { getc(fp1); skip1--; }
88 while (skip2) { getc(fp2); skip2--; } 85 while (skip2) { getc(fp2); skip2--; }
89#endif 86 }
90 do { 87 do {
91 c1 = getc(fp1); 88 c1 = getc(fp1);
92 c2 = getc(fp2); 89 c2 = getc(fp2);