]> asedeno.scripts.mit.edu Git - git.git/blobdiff - gitweb/gitweb.perl
gitweb: Use single implementation of export_ok check.
[git.git] / gitweb / gitweb.perl
index 63c793ec398f0c378c3e3ec94b2d5675bdff418e..68bdf62657f748839b771ba4d58e8cbc943c0f93 100755 (executable)
@@ -853,8 +853,7 @@ sub validate_project {
        my $input = shift || return undef;
        if (!validate_pathname($input) ||
                !(-d "$projectroot/$input") ||
-               !check_head_link("$projectroot/$input") ||
-               ($export_ok && !(-e "$projectroot/$input/$export_ok")) ||
+               !check_export_ok("$projectroot/$input") ||
                ($strict_export && !project_in_list($input))) {
                return undef;
        } else {
@@ -1957,7 +1956,10 @@ sub git_get_project_ctags {
        my $ctags = {};
 
        $git_dir = "$projectroot/$path";
-       foreach (<$git_dir/ctags/*>) {
+       unless (opendir D, "$git_dir/ctags") {
+               return $ctags;
+       }
+       foreach (grep { -f $_ } map { "$git_dir/ctags/$_" } readdir(D)) {
                open CT, $_ or next;
                my $val = <CT>;
                chomp $val;
@@ -1965,6 +1967,7 @@ sub git_get_project_ctags {
                my $ctag = $_; $ctag =~ s#.*/##;
                $ctags->{$ctag} = $val;
        }
+       closedir D;
        $ctags;
 }