summaryrefslogtreecommitdiff
path: root/usr/src/cmd/grep/grep.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/cmd/grep/grep.c')
-rw-r--r--usr/src/cmd/grep/grep.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr/src/cmd/grep/grep.c b/usr/src/cmd/grep/grep.c
index eabd465cca..7054d1f602 100644
--- a/usr/src/cmd/grep/grep.c
+++ b/usr/src/cmd/grep/grep.c
@@ -35,6 +35,7 @@
*/
/*
+ * Copyright 2018 RackTop Systems.
* Copyright 2018 Nexenta Systems, Inc.
* Copyright 2013 Damian Bogel. All rights reserved.
*/
@@ -1277,8 +1278,8 @@ L_start_process:
goto L_next_line;
/* Do we have room to add this line to the context buffer? */
- if ((line_len + 1) > (conbuflen -
- (conptrend >= conptr) ? conptrend - conbuf : 0)) {
+ while ((line_len + 1) > (conbuflen -
+ ((conptrend >= conptr) ? conptrend - conbuf : 0))) {
char *oldconbuf = conbuf;
char *oldconptr = conptr;
long tmp = matchptr - conptr;