The tiniest of bracket-placement fixes.
This commit is contained in:
parent
5d81768cf1
commit
59a86cad67
@ -112,8 +112,7 @@ static void grep_file(FILE *file)
|
|||||||
|
|
||||||
/* if we were told to print 'before' lines and there is at least
|
/* if we were told to print 'before' lines and there is at least
|
||||||
* one line in the circular buffer, print them */
|
* one line in the circular buffer, print them */
|
||||||
if (lines_before && before_buf[prevpos] != NULL)
|
if (lines_before && before_buf[prevpos] != NULL) {
|
||||||
{
|
|
||||||
int first_buf_entry_line_num = linenum - lines_before;
|
int first_buf_entry_line_num = linenum - lines_before;
|
||||||
|
|
||||||
/* advance to the first entry in the circular buffer, and
|
/* advance to the first entry in the circular buffer, and
|
||||||
@ -133,7 +132,6 @@ static void grep_file(FILE *file)
|
|||||||
idx = (idx + 1) % lines_before;
|
idx = (idx + 1) % lines_before;
|
||||||
first_buf_entry_line_num++;
|
first_buf_entry_line_num++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* make a note that we need to print 'after' lines */
|
/* make a note that we need to print 'after' lines */
|
||||||
@ -145,8 +143,7 @@ static void grep_file(FILE *file)
|
|||||||
#ifdef BB_FEATURE_GREP_CONTEXT
|
#ifdef BB_FEATURE_GREP_CONTEXT
|
||||||
else { /* no match */
|
else { /* no match */
|
||||||
/* Add the line to the circular 'before' buffer */
|
/* Add the line to the circular 'before' buffer */
|
||||||
if(lines_before)
|
if(lines_before) {
|
||||||
{
|
|
||||||
if(before_buf[curpos])
|
if(before_buf[curpos])
|
||||||
free(before_buf[curpos]);
|
free(before_buf[curpos]);
|
||||||
before_buf[curpos] = strdup(line);
|
before_buf[curpos] = strdup(line);
|
||||||
|
7
grep.c
7
grep.c
@ -112,8 +112,7 @@ static void grep_file(FILE *file)
|
|||||||
|
|
||||||
/* if we were told to print 'before' lines and there is at least
|
/* if we were told to print 'before' lines and there is at least
|
||||||
* one line in the circular buffer, print them */
|
* one line in the circular buffer, print them */
|
||||||
if (lines_before && before_buf[prevpos] != NULL)
|
if (lines_before && before_buf[prevpos] != NULL) {
|
||||||
{
|
|
||||||
int first_buf_entry_line_num = linenum - lines_before;
|
int first_buf_entry_line_num = linenum - lines_before;
|
||||||
|
|
||||||
/* advance to the first entry in the circular buffer, and
|
/* advance to the first entry in the circular buffer, and
|
||||||
@ -133,7 +132,6 @@ static void grep_file(FILE *file)
|
|||||||
idx = (idx + 1) % lines_before;
|
idx = (idx + 1) % lines_before;
|
||||||
first_buf_entry_line_num++;
|
first_buf_entry_line_num++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* make a note that we need to print 'after' lines */
|
/* make a note that we need to print 'after' lines */
|
||||||
@ -145,8 +143,7 @@ static void grep_file(FILE *file)
|
|||||||
#ifdef BB_FEATURE_GREP_CONTEXT
|
#ifdef BB_FEATURE_GREP_CONTEXT
|
||||||
else { /* no match */
|
else { /* no match */
|
||||||
/* Add the line to the circular 'before' buffer */
|
/* Add the line to the circular 'before' buffer */
|
||||||
if(lines_before)
|
if(lines_before) {
|
||||||
{
|
|
||||||
if(before_buf[curpos])
|
if(before_buf[curpos])
|
||||||
free(before_buf[curpos]);
|
free(before_buf[curpos]);
|
||||||
before_buf[curpos] = strdup(line);
|
before_buf[curpos] = strdup(line);
|
||||||
|
Loading…
Reference in New Issue
Block a user