Author: kremenek
Date: Mon Nov  3 01:44:16 2008
New Revision: 58600

URL: http://llvm.org/viewvc/llvm-project?rev=58600&view=rev
Log:
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>

Modified:
    cfe/trunk/utils/scan-build

Modified: cfe/trunk/utils/scan-build
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/scan-build?rev=58600&r1=58599&r2=58600&view=diff

==============================================================================
--- cfe/trunk/utils/scan-build (original)
+++ cfe/trunk/utils/scan-build Mon Nov  3 01:44:16 2008
@@ -932,9 +932,9 @@
   # 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/&/&amp;/g;
+  $tmp =~ s/</&lt;/g;
+  $tmp =~ s/>/&gt;/g;
   return $tmp;
 }
 
@@ -945,11 +945,8 @@
 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;
 }
 
 
##----------------------------------------------------------------------------##


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to