diff options
author | Matheus Izvekov <mizvekov@gmail.com> | 2010-01-18 14:25:46 -0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-20 02:44:44 +0100 |
commit | b7a044043ceae800a1f7abd69b107876ad5e9d40 (patch) | |
tree | c8f216e658d9be0fce61419671cb92283e2f4583 | |
parent | 302af9e3d1ea7e83f382b9c97fa9fe4099345126 (diff) | |
download | busybox-w32-b7a044043ceae800a1f7abd69b107876ad5e9d40.tar.gz busybox-w32-b7a044043ceae800a1f7abd69b107876ad5e9d40.tar.bz2 busybox-w32-b7a044043ceae800a1f7abd69b107876ad5e9d40.zip |
diff: honor flag -i (ignore case differences)
>>From 503a1e1d2597f7cdf86a9ea39ebd2aee050ca759 Mon Sep 17 00:00:00 2001
From: Matheus Izvekov <mizvekov@gmail.com>
Date: Mon, 18 Jan 2010 14:06:26 -0200
Subject: [PATCH] diff: honor flag -i (ignore case differences)
function old new delta
read_token 157 178 +21
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 21/0) Total: 21 bytes
text data bss dec hex filename
70102 733 8576 79411 13633 busybox_old
70123 733 8576 79432 13648 busybox_unstripped
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | editors/diff.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/editors/diff.c b/editors/diff.c index 0c75873b3..ef2030527 100644 --- a/editors/diff.c +++ b/editors/diff.c | |||
@@ -94,7 +94,7 @@ enum { /* Commandline flags */ | |||
94 | FLAG_a, | 94 | FLAG_a, |
95 | FLAG_b, | 95 | FLAG_b, |
96 | FLAG_d, | 96 | FLAG_d, |
97 | FLAG_i, /* unused */ | 97 | FLAG_i, |
98 | FLAG_L, /* unused */ | 98 | FLAG_L, /* unused */ |
99 | FLAG_N, | 99 | FLAG_N, |
100 | FLAG_q, | 100 | FLAG_q, |
@@ -177,6 +177,9 @@ static int read_token(FILE_and_pos_t *ft, token_t tok) | |||
177 | if (t == '\n') | 177 | if (t == '\n') |
178 | tok |= TOK_EOL; | 178 | tok |= TOK_EOL; |
179 | 179 | ||
180 | if (option_mask32 & FLAG(i)) /* Handcoded tolower() */ | ||
181 | t = (t >= 'A' && t <= 'Z') ? t - ('A' - 'a') : t; | ||
182 | |||
180 | if ((option_mask32 & FLAG(w)) && is_space) | 183 | if ((option_mask32 & FLAG(w)) && is_space) |
181 | continue; | 184 | continue; |
182 | 185 | ||