aboutsummaryrefslogtreecommitdiff
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
parent4640ccc39940a4842c62a9c1cf91f425b3f0bc99 (diff)
downloadbusybox-0c1ba443c83553e85d39e26ae4bb126a2c58ce93.tar.gz
cmp: ifdefectomy
Signed-off-by: Rob Landley <rob@landley.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-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)
{
FILE *fp1, *fp2, *outfile = stdout;
const char *filename1, *filename2 = "-";
- IF_DESKTOP(off_t skip1 = 0, skip2 = 0;)
- off_t char_pos = 0;
+ off_t skip1 = 0, skip2 = 0, char_pos = 0;
int line_pos = 1; /* Hopefully won't overflow... */
const char *fmt;
int c1, c2;
@@ -59,14 +58,12 @@ int cmp_main(int argc UNUSED_PARAM, char **argv)
if (*++argv) {
filename2 = *argv;
-#if ENABLE_DESKTOP
- if (*++argv) {
+ if (ENABLE_DESKTOP && *++argv) {
skip1 = XATOOFF(*argv);
if (*++argv) {
skip2 = XATOOFF(*argv);
}
}
-#endif
}
fp2 = xfopen_stdin(filename2);
@@ -83,10 +80,10 @@ int cmp_main(int argc UNUSED_PARAM, char **argv)
else
fmt = fmt_differ;
-#if ENABLE_DESKTOP
- while (skip1) { getc(fp1); skip1--; }
- while (skip2) { getc(fp2); skip2--; }
-#endif
+ if (ENABLE_DESKTOP) {
+ while (skip1) { getc(fp1); skip1--; }
+ while (skip2) { getc(fp2); skip2--; }
+ }
do {
c1 = getc(fp1);
c2 = getc(fp2);