The previous code incorrectly added `sub_path` twice.
Also for the compilation unit, it was passing empty string to realpath,
resulting in the error handling codepath being used.
closes #17482
69dc1a6bb2Andrew Kelley committed on 10/13/2023, 10:07:50 AMparent2769215