[cfe-commits] r55813 - /cfe/trunk/utils/scan-build

Ted Kremenek kremenek at apple.com
Thu Sep 4 16:56:36 PDT 2008


Author: kremenek
Date: Thu Sep  4 18:56:36 2008
New Revision: 55813

URL: http://llvm.org/viewvc/llvm-project?rev=55813&view=rev
Log:
Patch to scan-build by Jordan Breeding:
- Don't remove $BaseDir; may be unsafe
- Always create HTML directory with parents


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=55813&r1=55812&r2=55813&view=diff

==============================================================================
--- cfe/trunk/utils/scan-build (original)
+++ cfe/trunk/utils/scan-build Thu Sep  4 18:56:36 2008
@@ -196,14 +196,15 @@
   die "RunNumber must be defined!" if (!defined $RunNumber);
   
   # Append the run number.
+  my $NewDir;
   if ($TmpMode) {
-    my $NewDir = "$Dir/$Prog-$DateString-$RunNumber";
-    mkdir $NewDir;
-    return $NewDir;
+    $NewDir = "$Dir/$Prog-$DateString-$RunNumber";
   }
   else {
-    return "$Dir/$DateString-$RunNumber";
+    $NewDir = "$Dir/$DateString-$RunNumber";
   }
+  system 'mkdir','-p',$NewDir;
+  return $NewDir;
 }
 
 sub SetHtmlEnv {
@@ -401,8 +402,6 @@
   if (scalar(@files) == 0 and $Crashes == 0) {
     Diag("Removing directory '$Dir' because it contains no reports.\n");
     system ("rm", "-fR", $Dir);
-    # Remove the base directory if it contains no files (don't use '-R').
-    system ("rm", "-f", $BaseDir) if (defined $BaseDir);
     return 0;
   }
   





More information about the cfe-commits mailing list