Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F139419169
D10824.id28579.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D10824.id28579.diff
View Options
Index: usr.bin/grep/grep.h
===================================================================
--- usr.bin/grep/grep.h
+++ usr.bin/grep/grep.h
@@ -82,7 +82,7 @@
#define EXCL_PAT 0
#define INCL_PAT 1
-#define MAX_LINE_MATCHES 32
+#define MAX_MATCHES 32
struct file {
int fd;
Index: usr.bin/grep/util.c
===================================================================
--- usr.bin/grep/util.c
+++ usr.bin/grep/util.c
@@ -61,7 +61,7 @@
* other useful bits
*/
struct parsec {
- regmatch_t matches[MAX_LINE_MATCHES]; /* Matches made */
+ regmatch_t matches[MAX_MATCHES]; /* Matches made */
struct str ln; /* Current line */
size_t matchidx; /* Latest used match index */
bool binary; /* Binary file? */
@@ -384,7 +384,7 @@
lastmatches = 0;
startm = matchidx;
retry = 0;
- if (st > 0)
+ if (st > 0 && pc->ln.dat[st - 1] != fileeol)
leflags |= REG_NOTBOL;
/* Loop to compare with all the patterns */
for (i = 0; i < patterns; i++) {
@@ -466,7 +466,7 @@
}
/* avoid excessive matching - skip further patterns */
if ((color == NULL && !oflag) || qflag || lflag ||
- matchidx >= MAX_LINE_MATCHES)
+ matchidx >= MAX_MATCHES)
break;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 12, 9:06 PM (12 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26912616
Default Alt Text
D10824.id28579.diff (1 KB)
Attached To
Mode
D10824: bsdgrep(1): Correct some minor assumptions to prepare for later chunking efforts
Attached
Detach File
Event Timeline
Log In to Comment