Change endpat to allow for one-line if-blocks

In e.g. matlab, the beginning and end of the pattern may be on the same line.