version 1.67, 2022/07/12 18:09:31 |
version 1.68, 2023/11/15 00:50:43 |
|
|
procline(str_t *l, int nottext) |
procline(str_t *l, int nottext) |
{ |
{ |
regmatch_t pmatch = { 0 }; |
regmatch_t pmatch = { 0 }; |
int c, i, r; |
int c, i, r, counted; |
regoff_t offset; |
regoff_t offset; |
|
|
/* size_t will be converted to regoff_t. ssize_t is guaranteed to fit |
/* size_t will be converted to regoff_t. ssize_t is guaranteed to fit |
|
|
|
|
c = 0; |
c = 0; |
i = 0; |
i = 0; |
|
counted = 0; |
if (matchall) { |
if (matchall) { |
c = 1; |
c = 1; |
goto print; |
goto print; |
|
|
if (vflag) |
if (vflag) |
c = !c; |
c = !c; |
|
|
/* Count the matches if we have a match limit */ |
/* Count the matches if there is a match limit (but only once). */ |
if (mflag) |
if (mflag && !counted) { |
mcount -= c; |
mcount -= c; |
|
counted = 1; |
|
} |
|
|
if (c && binbehave == BIN_FILE_BIN && nottext) |
if (c && binbehave == BIN_FILE_BIN && nottext) |
return c; /* Binary file */ |
return c; /* Binary file */ |