diff --git a/btrbk b/btrbk index 83b2378..f7fdf55 100755 --- a/btrbk +++ b/btrbk @@ -3899,9 +3899,8 @@ sub check_file($$;@) return undef; } if($sanitize) { - $file =~ s/\/+/\//g; # sanitize multiple slash - $file =~ s/\/\.\//\//g; # sanitize "/./" -> "/" - $file =~ s/\/\.$/\//; # sanitize trailing "/." -> "/" + $file =~ s/\/(\.?\/)+/\//g; # sanitize "//", "/./" -> "/" + $file =~ s/\/\.$/\//; # sanitize trailing "/." -> "/" $file =~ s/\/$// unless($file eq '/'); # remove trailing slash } return $file;