aboutsummaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-09-26 14:10:17 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-09-26 14:10:17 +0000
commit48a6773b3ae627a67ab7b191df0063dcefc3f470 (patch)
tree8d6a07081b087e82771b88e8a16ad769835e0175 /miscutils
parentfd3552dff905e03842197291a2a3627acd53756c (diff)
downloadbusybox-48a6773b3ae627a67ab7b191df0063dcefc3f470.tar.gz
- add less -I to be able to search case-insensitively
+17b, but the helptext is quite elaborate, thus: function old new delta .rodata 118995 119032 +37 packed_usage 24731 24767 +36 regex_process 284 300 +16 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 89/0) Total: 89 bytes
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/less.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/miscutils/less.c b/miscutils/less.c
index 530a40a8c..cd47590ee 100644
--- a/miscutils/less.c
+++ b/miscutils/less.c
@@ -79,6 +79,7 @@ enum {
FLAG_m = 1 << 2,
FLAG_N = 1 << 3,
FLAG_TILDE = 1 << 4,
+ FLAG_I = 1 << 5,
/* hijack command line options variable for internal state vars */
LESS_STATE_MATCH_BACKWARDS = 1 << 15,
};
@@ -965,7 +966,8 @@ static void regex_process(void)
}
/* Compile the regex and check for errors */
- err = regcomp_or_errmsg(&pattern, uncomp_regex, 0);
+ err = regcomp_or_errmsg(&pattern, uncomp_regex,
+ option_mask32 & FLAG_I ? REG_ICASE : 0);
free(uncomp_regex);
if (err) {
print_statusline(err);
@@ -1359,7 +1361,7 @@ int less_main(int argc, char **argv)
/* TODO: -x: do not interpret backspace, -xx: tab also */
/* -xxx: newline also */
/* -w N: assume width N (-xxx -w 32: hex viewer of sorts) */
- getopt32(argv, "EMmN~");
+ getopt32(argv, "EMmN~I");
argc -= optind;
argv += optind;
num_files = argc;