PotentialMatch: fix end-of-string check, part 2.
PotentialMatch: fix end-of-string check, part 2.

Does the same thing as the previous commit, but now also for the first
string.

Again fixes bug 7922238 (https://bugzilla.gnome.org/show_bug.cgi?id=792238).

pwithnall/folks,GNOME/folks,GNOME/folks,pwithnall/folks,pwithnall/folks,GNOME/folks