use the library for path manipulation

Here we're stripping off an initial 'src' segment from
a relative path. Use the well-tested library function
(and gain error checking!) instead of writing our own.