]> git.pld-linux.org Git - packages/busybox.git/blame - busybox-grep.patch
- BR uClibc-static >= 3:0.9.30.1 (it has combreloc|relro filtering built in)
[packages/busybox.git] / busybox-grep.patch
CommitLineData
c299c52b 1diff -urpN busybox-1.12.1/findutils/grep.c busybox-1.12.1-grep/findutils/grep.c
2--- busybox-1.12.1/findutils/grep.c 2008-09-28 20:04:28.000000000 +0200
3+++ busybox-1.12.1-grep/findutils/grep.c 2008-10-10 14:39:09.000000000 +0200
4@@ -363,12 +363,22 @@ static int grep_file(FILE *file)
5 * (unless -v: -Fov doesnt print anything at all) */
6 if (found)
7 print_line(gl->pattern, strlen(gl->pattern), linenum, ':');
8- } else {
9+ } else while (1) {
10+ char old = line[gl->matched_range.rm_eo];
11 line[gl->matched_range.rm_eo] = '\0';
12 print_line(line + gl->matched_range.rm_so,
13 gl->matched_range.rm_eo - gl->matched_range.rm_so,
14 linenum, ':');
15- }
16+ line[gl->matched_range.rm_eo] = old;
17+#if !ENABLE_EXTRA_COMPAT
18+ break;
19+#else
20+ if (re_search(&gl->compiled_regex, line, line_len,
21+ gl->matched_range.rm_eo, line_len - gl->matched_range.rm_eo,
22+ &gl->matched_range) < 0)
23+ break;
24+#endif
25+ }
26 } else {
27 print_line(line, line_len, linenum, ':');
28 }
This page took 0.078026 seconds and 4 git commands to generate.