From 00cd26eaeb228a43ccec068fb7388ccefa6ff1df Mon Sep 17 00:00:00 2001 From: DastInDark <2350416+hitenkoku@users.noreply.github.com> Date: Mon, 18 Jul 2022 13:30:38 +0900 Subject: [PATCH] Due to path.is_absolute is not check included relative path in absolute path. --- src/detections/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/detections/utils.rs b/src/detections/utils.rs index f9d7071a..2f38de0a 100644 --- a/src/detections/utils.rs +++ b/src/detections/utils.rs @@ -396,7 +396,7 @@ pub fn check_setting_path(base_path: &Path, path: &str) -> PathBuf { /// 与えられたoption_pathが相対パスであるかを確認し、絶対パスであればそのまま絶対パスのまま文字列として返却を行い、 /// 相対パスであれば、カレントディレクトリとの相対パスの文字列から不要な(./、../)を除外した文字列を返却する関数 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() } else { let diff_path_result = diff_paths(target_path, &env::current_dir().unwrap());