0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

file2string: mark question mark as non-safe

Escaping all question marks as well, they can be used to form
trigraph characters which are effective even within string literal.
This commit is contained in:
Bin Jin 2015-10-28 17:48:29 +00:00 committed by wm4
parent 4c43c30421
commit 3f73d63523

View File

@ -9,8 +9,8 @@ use warnings;
# the exact contents of the original file.
# FIXME: why not a char array?
# treat only alphanumeric and not-" punctuation as safe
my $unsafe_chars = qr{[^][A-Za-z0-9!#%&'()*+,./:;<=>?^_{|}~ -]};
# treat only alphanumeric and punctuations (excluding " and ?) as safe
my $unsafe_chars = qr{[^][A-Za-z0-9!#%&'()*+,./:;<=>^_{|}~ -]};
for my $file (@ARGV) {
open my $fh, '<:raw', $file or next;