Due to path.is_absolute is not check included relative path in absolute path.

This commit is contained in:
DastInDark
2022-07-18 13:30:38 +09:00
parent 564500b52d
commit 00cd26eaeb

View File

@@ -396,7 +396,7 @@ pub fn check_setting_path(base_path: &Path, path: &str) -> PathBuf {
/// 与えられたoption_pathが相対パスであるかを確認し、絶対パスであればそのまま絶対パスのまま文字列として返却を行い、 /// 与えられたoption_pathが相対パスであるかを確認し、絶対パスであればそのまま絶対パスのまま文字列として返却を行い、
/// 相対パスであれば、カレントディレクトリとの相対パスの文字列から不要な(./、../)を除外した文字列を返却する関数 /// 相対パスであれば、カレントディレクトリとの相対パスの文字列から不要な(./、../)を除外した文字列を返却する関数
pub fn get_output_str_path(option_path: &Path, target_path: &Path) -> String { pub fn get_output_str_path(option_path: &Path, target_path: &Path) -> String {
if option_path.is_absolute() { if option_path.is_absolute() && !OUTPUT_OMIT_REGEX.is_match(option_path.to_str().unwrap()) {
target_path.to_str().unwrap().to_string() target_path.to_str().unwrap().to_string()
} else { } else {
let diff_path_result = diff_paths(target_path, &env::current_dir().unwrap()); let diff_path_result = diff_paths(target_path, &env::current_dir().unwrap());