Fix showstopping bug (^ wouldn't match after \n). Jeffrey Ollie.

This commit is contained in:
Guido van Rossum 1997-05-14 18:27:51 +00:00
parent 34570d7669
commit fc4f503762

View file

@ -1914,7 +1914,7 @@ int re_search(regexp_t bufp,
} }
if (anchor == 1) if (anchor == 1)
{ /* anchored to begline */ { /* anchored to begline */
if (pos > 0 && string[pos - 1]) if (pos > 0 && (string[pos - 1] != '\n'))
continue; continue;
} }
assert(pos >= 0 && pos <= size); assert(pos >= 0 && pos <= size);