Changeset 21413


Ignore:
Timestamp:
01/04/10 23:12:32 (11 years ago)
Author:
davidb
Message:

pathname_cat() performs comparable task to filename_cat(), only used for concatenating items used in CLASSPATH and LD_LIBRARY_PATH

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/util.pm

    r21218 r21413  
    641641}
    642642
     643
     644sub pathname_cat {
     645    my $first_path = shift(@_);
     646    my (@pathnames) = @_;
     647
     648    # If first_path is not null or empty, then add it back into the list
     649    if (defined $first_path && $first_path =~ /\S/) {
     650    unshift(@pathnames, $first_path);
     651    }
     652
     653    my join_char;
     654    if ($ENV{'GSDLOS'} =~ /^windows$/i) {
     655    $join_char = ";";
     656    } else {
     657    $join_char = ":";
     658    }
     659
     660    my $pathname = join($join_char, @pathnames);
     661
     662    # remove duplicate slashes
     663    if ($ENV{'GSDLOS'} =~ /^windows$/i) {
     664    $pathname =~ s/[\\\/]+/\\/g;
     665    } else {
     666    $pathname =~ s/[\/]+/\//g;
     667    # DB: want a pathname abc\de.html to remain like this
     668    }
     669
     670    return $pathname;
     671}
     672
     673
    643674sub tidy_up_oid {
    644675    my ($OID) = @_;
Note: See TracChangeset for help on using the changeset viewer.