version 1.71, 2022/08/03 07:30:37 |
version 1.72, 2023/07/12 11:26:13 |
|
|
static void spew_output(void); |
static void spew_output(void); |
static void dump_line(LINENUM, bool); |
static void dump_line(LINENUM, bool); |
static bool patch_match(LINENUM, LINENUM, LINENUM); |
static bool patch_match(LINENUM, LINENUM, LINENUM); |
static bool similar(const char *, const char *, int); |
static bool similar(const char *, const char *, ssize_t); |
static __dead void usage(void); |
static __dead void usage(void); |
|
|
/* true if -E was specified on command line. */ |
/* true if -E was specified on command line. */ |
|
|
LINENUM pat_lines = pch_ptrn_lines() - fuzz; |
LINENUM pat_lines = pch_ptrn_lines() - fuzz; |
const char *ilineptr; |
const char *ilineptr; |
const char *plineptr; |
const char *plineptr; |
short plinelen; |
ssize_t plinelen; |
|
|
for (iline = base + offset + fuzz; pline <= pat_lines; pline++, iline++) { |
for (iline = base + offset + fuzz; pline <= pat_lines; pline++, iline++) { |
ilineptr = ifetch(iline, offset >= 0); |
ilineptr = ifetch(iline, offset >= 0); |
|
|
* Do two lines match with canonicalized white space? |
* Do two lines match with canonicalized white space? |
*/ |
*/ |
static bool |
static bool |
similar(const char *a, const char *b, int len) |
similar(const char *a, const char *b, ssize_t len) |
{ |
{ |
while (len) { |
while (len) { |
if (isspace((unsigned char)*b)) { /* whitespace (or \n) to match? */ |
if (isspace((unsigned char)*b)) { /* whitespace (or \n) to match? */ |