diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-11-09 17:21:26 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-11-09 17:21:26 +0000 |
| commit | 84641942e5366b2e09367ba4f4376c99f15ecc8e (patch) | |
| tree | eff2511dcc6cb647e0bf898903f86c94b85466ad /findutils | |
| parent | bacaff6e5474d6c5f080ce4cd2a55e8ff1ba5c94 (diff) | |
| download | busybox-w32-1_12_2.tar.gz busybox-w32-1_12_2.tar.bz2 busybox-w32-1_12_2.zip | |
apply post-1.12.1 patches, bump version to 1.12.21_12_2
Diffstat (limited to 'findutils')
| -rw-r--r-- | findutils/grep.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/findutils/grep.c b/findutils/grep.c index 9d38ef912..73e74f4b3 100644 --- a/findutils/grep.c +++ b/findutils/grep.c | |||
| @@ -363,12 +363,22 @@ static int grep_file(FILE *file) | |||
| 363 | * (unless -v: -Fov doesnt print anything at all) */ | 363 | * (unless -v: -Fov doesnt print anything at all) */ |
| 364 | if (found) | 364 | if (found) |
| 365 | print_line(gl->pattern, strlen(gl->pattern), linenum, ':'); | 365 | print_line(gl->pattern, strlen(gl->pattern), linenum, ':'); |
| 366 | } else { | 366 | } else while (1) { |
| 367 | char old = line[gl->matched_range.rm_eo]; | ||
| 367 | line[gl->matched_range.rm_eo] = '\0'; | 368 | line[gl->matched_range.rm_eo] = '\0'; |
| 368 | print_line(line + gl->matched_range.rm_so, | 369 | print_line(line + gl->matched_range.rm_so, |
| 369 | gl->matched_range.rm_eo - gl->matched_range.rm_so, | 370 | gl->matched_range.rm_eo - gl->matched_range.rm_so, |
| 370 | linenum, ':'); | 371 | linenum, ':'); |
| 371 | } | 372 | line[gl->matched_range.rm_eo] = old; |
| 373 | #if !ENABLE_EXTRA_COMPAT | ||
| 374 | break; | ||
| 375 | #else | ||
| 376 | if (re_search(&gl->compiled_regex, line, line_len, | ||
| 377 | gl->matched_range.rm_eo, line_len - gl->matched_range.rm_eo, | ||
| 378 | &gl->matched_range) < 0) | ||
| 379 | break; | ||
| 380 | #endif | ||
| 381 | } | ||
| 372 | } else { | 382 | } else { |
| 373 | print_line(line, line_len, linenum, ':'); | 383 | print_line(line, line_len, linenum, ':'); |
| 374 | } | 384 | } |
