Fix an ancient bug in prefix factoring.

Regexp::LeadingString didn't output Latin1 into flags.
In the given pattern, 0xA5 should be factored out, but
shouldn't lose its Latin1-ness in the process. Because
that was happening, the prefix for accel was 0xC2 0xA5
instead of 0xA5. Note that the former doesn't occur in
the given input and so replacements weren't occurring.

Fixes #477.

Change-Id: Icd36ba0905684d93d6db58e8047c9787918d0cf4
Reviewed-on: https://code-review.googlesource.com/c/re2/+/62713
Reviewed-by: Paul Wankadia <junyer@google.com>
Reviewed-by: Jashank Jeremy <jashankj@google.com>
2 files changed