Just in theory, perhaps not the most convenient way of achieving it, but here it goes.
Code:
1) Read the desired buffer_length of the file
(could be a single line/ portion of a line/ whatever)
2) Search for the patern / or as much of the first part of the
patern, when getting closer than strlen(pattern) to end of buffer
3) If the first part of the pattern matched at the end of the buffer
search for the remainder of the pattern as the beginning of the
next read from file, skipping what ever newline char there might
have been, if the pattern was split over two lines in the file.