Ignore:
Timestamp:
2005-07-05T15:57:24+12:00 (19 years ago)
Author:
davidb
Message:

Introduction of envvar_append() to append items into an environment variable
such as PATH in a platform independent way. It is assumed the variable
passed in (typically representing a filename) is already OS compliant
(i.e. has used filename_cat() to construct it).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/util.pm

    r10211 r10212  
    537537
    538538
     539sub envvar_prepend {
     540    my ($var,$val) = @_;
     541
     542    my $current_val = $ENV{$var};
     543   
     544    if ($ENV{'GSDLOS'} =~ /^windows$/i) {
     545    $ENV{$var} .= "$val;$current_val";
     546    }
     547    else {
     548    $ENV{$var} .= "$val:$current_val";
     549    }
     550}
     551
     552sub envvar_append {
     553    my ($var,$val) = @_;
     554
     555    if ($ENV{'GSDLOS'} =~ /^windows$/i) {
     556    $ENV{$var} .= ";$val";
     557    }
     558    else {
     559    $ENV{$var} .= ":$val";
     560    }
     561}
     562
     563
    539564# returns the path of a file without the filename -- ie. the directory the file is in
    540565sub filename_head {
Note: See TracChangeset for help on using the changeset viewer.