aboutsummaryrefslogtreecommitdiffstats
path: root/lxr-genxref
diff options
context:
space:
mode:
Diffstat (limited to 'lxr-genxref')
-rwxr-xr-xlxr-genxref9
1 files changed, 9 insertions, 0 deletions
diff --git a/lxr-genxref b/lxr-genxref
index 2e44091..f64fe78 100755
--- a/lxr-genxref
+++ b/lxr-genxref
@@ -280,10 +280,18 @@ sub reference_file($$$) {
sub hash_file($$$) {
my ($file, $fileid, $rels) = @_;
+ return 0 if $context->config->{'search_size_limit'} > 0 and
+ $file->size > $context->config->{'search_size_limit'};
+
my $docid;
if ($index->to_hash($fileid)) {
my $handle;
sysopen($handle, $file->phys_path, 0) || die($!);
+ unless (-T $handle) {
+ $handle->close();
+ return 0;
+ }
+
warn("--- hashing ".$file->name." [".$file->revision."]\n");
my $doc = $hash->new_document($file->name);
my $charset = $context->config->{'content_charset'} || [];
@@ -313,6 +321,7 @@ sub hash_file($$$) {
}
else {
$docid = $index->get_hashed_document($fileid);
+ return 0 unless $docid;
my $doc = $hash->get_document($docid);
if (reference_file($file, $fileid, $doc)) {
$hash->save_document($docid, $doc);