fix a sed portability issue

In 31b5ea7dacbd7c83874e1e6a9da7e7b49ccfd048 we fixed one sed portability issue introduced in #2831. Here's another.