A failing inc search does another search each time a new input char is added to the string. It should realize that once it is failing new characters can't make it successful.