Changeset 2657 for trunk


Ignore:
Timestamp:
2001-07-18T11:57:01+12:00 (23 years ago)
Author:
jrm21
Message:

fixed a bug when #including a macro (ie no "... or <... on the line)

File:
1 edited

Legend:

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

    r2085 r2657  
    120120    ($title = $file) =~ s/^$self->{'remove_prefix'}//;
    121121    } else {
    122     ($title = $file) =~ s@^.*(/|\\)@@; # remove pathname by default
     122    ($title = $file) =~ s@^.*[/\\]@@; # remove pathname by default
    123123    }
    124124    $doc_obj->add_utf8_metadata ($cursection, "Title", $title);
    125     $doc_obj->add_utf8_metadata ($cursection, "filename", $file);
     125    # remove the gsdl prefix from the filename
     126    my $relative_filename=$file;
     127    $relative_filename =~ s@^.*?gsdl[/\\]@@;
     128    $doc_obj->add_utf8_metadata ($cursection, "filename", $relative_filename);
    126129
    127130    # class information from .h and .cc and .C and .cpp files
     
    166169    # '#  include ...'
    167170    # '  #include ...'
    168     while ($includes =~ /\#\W?include/) {
     171    # also make sure it contains an actual filename, as we don't
     172    # do pre-processing (eg #including a macro).
     173    while ($includes =~ /\#\s*include.*(\"|&lt;)/) {
    169174        $includes =~ s/^.*?include.*?(\"|&lt;)(.*)(\"|&gt;).*$//m;
    170         # $1 is now the filename between the "s.
    171175        my $include=$2;
    172176        # remove leading pathname
Note: See TracChangeset for help on using the changeset viewer.