Skip to content

Commit 99be3b3

Browse files
authored
escape regex special chars in guess_prefix. Resolves #411 (#412)
1 parent ced84e9 commit 99be3b3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

bin/snippy-core

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ sub guess_prefix {
153153
for my $try ("$dir/$in_prefix.$ext", <$dir/*.$ext>) {
154154
#msg("Checking if file exists: $try");
155155
if (-r $try) {
156-
$try =~ m"^$dir/(.*?).$ext";
156+
$try =~ m"^\Q$dir\E/(.*?).$ext";
157157
return $1;
158158
}
159159
}

0 commit comments

Comments
 (0)