зеркало из https://github.com/microsoft/clang.git
Simplify the functions HtmlEsape and ShellEscape. We now properly print out the following command line in the HTML output: scan-build gcc -x c /dev/null -c -Dfoo='"string abc"'
Fixes <rdar://problem/6338651> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58600 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
f8fc414bc0
Коммит
87f8de72a3
|
@ -932,9 +932,9 @@ sub HtmlEscape {
|
|||
# copy argument to new variable so we don't clobber the original
|
||||
my $arg = shift || '';
|
||||
my $tmp = $arg;
|
||||
|
||||
$tmp =~ s/([\<\>\'\"])/sprintf("&#%02x;", chr($1))/ge;
|
||||
|
||||
$tmp =~ s/&/&/g;
|
||||
$tmp =~ s/</</g;
|
||||
$tmp =~ s/>/>/g;
|
||||
return $tmp;
|
||||
}
|
||||
|
||||
|
@ -945,11 +945,8 @@ sub HtmlEscape {
|
|||
sub ShellEscape {
|
||||
# copy argument to new variable so we don't clobber the original
|
||||
my $arg = shift || '';
|
||||
my $tmp = $arg;
|
||||
|
||||
$tmp =~ s/([\!\;\\\'\"\`\<\>\|\s\(\)\[\]\?\#\$\^\&\*\=])/\\$1/g;
|
||||
|
||||
return $tmp;
|
||||
if ($arg =~ /["\s]/) { return "'" . $arg . "'"; }
|
||||
return $arg;
|
||||
}
|
||||
|
||||
##----------------------------------------------------------------------------##
|
||||
|
|
Загрузка…
Ссылка в новой задаче