Changeset 10277


Ignore:
Timestamp:
2005-07-25T14:00:12+12:00 (19 years ago)
Author:
chi
Message:

tidy up the filename in add_file().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/HTMLPlug.pm

    r10218 r10277  
    118118    my ($pluginlist,$inputargs,$hashArgOptLists) = @_;
    119119    push(@$pluginlist, $class);
    120 
     120   
    121121    if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    122122    if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
     123   
    123124
    124125    my $self = (defined $hashArgOptLists)? new BasPlug($pluginlist,$inputargs,$hashArgOptLists): new BasPlug($pluginlist,$inputargs);
    125 
     126   
    126127    if ($self->{'w3mir'}) {
    127128    $self->{'file_is_url'} = 1;
    128129    }
    129    
    130130    $self->{'aux_files'} = {};
    131131    $self->{'dir_num'} = 0;
     
    158158   
    159159    my ($language, $encoding) = $self->textcat_get_language_encoding ($filename);
    160    
     160
    161161    # read in file ($text will be in utf8)
    162162    my $text = "";
     
    212212      $file =~ s@(\\)+@/@g;
    213213    }
    214 
     214   
    215215    # reset per-doc stuff...
    216216    $self->{'aux_files'} = {};
     
    484484    # is an escape code following. (Macro parsing loses them...)
    485485    $$textref =~ s/\\/\\\\/go;
     486   
    486487    $doc_obj->add_utf8_text($cursection, $$textref);
    487488}
     
    572573
    573574    my $filename = $href;
    574     $filename =~ s/^[^:]*:\/\///;
     575    if ($base_dir eq "") {
     576    # remove http:/ thereby leaving one slash at the start
     577    $filename =~ s/^[^:]*:\///;
     578    }
     579    else {
     580    # remove http://
     581    $filename =~ s/^[^:]*:\/\///;
     582    }
     583
    575584    $filename = &util::filename_cat($base_dir, $filename);
    576585       
Note: See TracChangeset for help on using the changeset viewer.