It is valid to have user.dir value set to root ("/") (and this happens when subprocesses are used to launch the epubcheck via the commandline) but this routine then breaks all paths:
static final String workingDirectory = System.getProperty("user.dir");
The previous implementation of the `removeWorkingDirectory` utility
method was quite brutal and replaced all occurences of the "user.dir"
system property in paths, even when found in the middle of the path.
The new implementation only replaces the user directory when it occurs
at the beginning of the path, and does nothing when the user directory
is set to the root directory ("/").
Tests included.
Fixes#1181
The previous implementation of the `removeWorkingDirectory` utility
method was quite brutal and replaced all occurences of the "user.dir"
system property in paths, even when found in the middle of the path.
The new implementation only replaces the user directory when it occurs
at the beginning of the path, and does nothing when the user directory
is set to the root directory ("/").
Tests included.
Fixes#1181
It is valid to have user.dir value set to root ("/") (and this happens when subprocesses are used to launch the epubcheck via the commandline) but this routine then breaks all paths:
By replacing all "/" chars in path to "." chars. Given "." chars are valid in filenames and directory names, this replacement is unfixable.
Please make this routine robust to all possible legal values for user.dir
The text was updated successfully, but these errors were encountered: