Change substitute_path_component to use std::string

This changes substitute_path_component to use std::string and
std::string_view, simplifying it greatly and removing some manual
memory management.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
1 file changed