aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xicevault8
1 files changed, 5 insertions, 3 deletions
diff --git a/icevault b/icevault
index 07a03a8..40eaf4b 100755
--- a/icevault
+++ b/icevault
@@ -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;
}