file.blockreplace: fix typo endswith

PR#11137 introduced that bug.
Not sure why it did not show on tests.
Noticed it by running (at last) tests on my side!