1349 |
|
|
1350 |
/* We have to split the line(s) up if colouring, and search for further |
/* We have to split the line(s) up if colouring, and search for further |
1351 |
matches, but not of course if the line is a non-match. */ |
matches, but not of course if the line is a non-match. */ |
1352 |
|
|
1353 |
if (do_colour && !invert) |
if (do_colour && !invert) |
1354 |
{ |
{ |
1355 |
int plength; |
int plength; |
1356 |
int last_offset = 0; |
int last_offset = 0; |
1357 |
FWRITE(ptr, 1, offsets[0], stdout); |
FWRITE(ptr, 1, offsets[0], stdout); |
1358 |
fprintf(stdout, "%c[%sm", 0x1b, colour_string); |
fprintf(stdout, "%c[%sm", 0x1b, colour_string); |
1372 |
} |
} |
1373 |
|
|
1374 |
/* In multiline mode, we may have already printed the complete line |
/* In multiline mode, we may have already printed the complete line |
1375 |
and its line-ending characters (if they matched the pattern), so there |
and its line-ending characters (if they matched the pattern), so there |
1376 |
may be no more to print. */ |
may be no more to print. */ |
1377 |
|
|
1378 |
plength = (linelength + endlinelength) - last_offset; |
plength = (linelength + endlinelength) - last_offset; |
1379 |
if (plength > 0) |
if (plength > 0) |
1380 |
FWRITE(ptr + last_offset, 1, plength, stdout); |
FWRITE(ptr + last_offset, 1, plength, stdout); |