mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-11 14:10:34 +00:00
bsdgrep: Handle special case of single-byte NUL pattern
PR: 202022 Submitted by: Kyle Evans <kevans91 at ksu.edu> MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D10102
This commit is contained in:
parent
6916de8666
commit
d204af1e41
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=316542
@ -314,8 +314,12 @@ read_patterns(const char *fn)
|
||||
}
|
||||
len = 0;
|
||||
line = NULL;
|
||||
while ((rlen = getline(&line, &len, f)) != -1)
|
||||
while ((rlen = getline(&line, &len, f)) != -1) {
|
||||
if (line[0] == '\0')
|
||||
continue;
|
||||
add_pattern(line, line[0] == '\n' ? 0 : (size_t)rlen);
|
||||
}
|
||||
|
||||
free(line);
|
||||
if (ferror(f))
|
||||
err(2, "%s", fn);
|
||||
|
Loading…
Reference in New Issue
Block a user