commit cb8467de96056c2bef1d9ff538e01ad72bc0506c from: Omar Polo date: Tue Oct 17 07:11:19 2023 UTC decode file names in the current locale Otherwise we output gibberish and the pattern argument to `plass find' may not even match the entries. Issue reported by Anton Kasimov, thank you! commit - 2dd3bc77c08841eaa269cb0a333ded1097558d5b commit + cb8467de96056c2bef1d9ff538e01ad72bc0506c blob - 3307f86adfd9bd1309ae725d7a463439d4d802e2 blob + 70ca3e110f7197415b2c2aa8e00cda0ed878162d --- plass +++ plass @@ -20,12 +20,17 @@ use v5.32; use open ":std", ":encoding(UTF-8)"; +use Encode::Locale qw(decode_argv); +use Encode qw(decode); + use Getopt::Long qw(:config bundling require_order); use File::Basename; use File::Find; use File::Path qw(make_path); use File::Temp qw(tempfile); +decode_argv; + my $store = $ENV{'PLASS_STORE'} // $ENV{'HOME'}.'/.password-store'; my $gpg = $ENV{'PLASS_GPG'} // 'gpg'; @@ -115,11 +120,13 @@ sub passfind { find({ wanted => sub { + my $raw = $_; + $_ = decode(locale => $_); if (m,/.git$, || m,/.got$,) { $File::Find::prune = 1; return; } - return unless -f && m,.gpg$,; + return unless -f $raw && m,.gpg$,; s,^$store/*,,; s,.gpg$,,;