threads / patch / 4821

patchgitweb.cgi: Create $git_temp if it doesn't exist

Subject: [PATCH] gitweb.cgi: Create $git_temp if it doesn't exist

## tl;dr

One message between Jul 10, 2006 and Jul 10, 2006. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Luben Tuikov· Jul 10, 2006, 03:07 UTC · lore

Unless we'd done diffs, $git_temp doesn't exist and then mime lookups fail. Explicitly create it, if it doesn't exist already.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
 gitweb/gitweb.cgi |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
Show changes to gitweb/gitweb.cgi +3 −0
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 6798990..d37f4c6 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -41,6 +41,9 @@ if ($git_version =~ m/git version (.*)$/
 
 # location for temporary files needed for diffs
 our $git_temp = "/tmp/gitweb";
+if (! -d $git_temp) {
+    mkdir($git_temp, 0700) || die_error("Couldn't mkdir $git_temp");
+}
 
 # target of the home link on top of all pages
 our $home_link = $my_uri;
-- 
1.4.1.g35dbd

← back to recent threads