diff options
-rwxr-xr-x | icevault | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -256,9 +256,11 @@ sub getIdentityFile($) { my ($s, $h, $i) = ($1, $2, $3); my $file = $CONFIG{store}; - $file =~ s/%s/$s/g; - $file =~ s/%h/$h/g; - $file =~ s/%i/$i/g; + $file =~ s{\%(.)}{ $1 eq '%' ? '%' : + $1 eq 's' ? $s : + $1 eq 'h' ? $h : + $1 eq 'i' ? $i : + die "Invalid placeholder %$1" }ge; return $file; } |