diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2004-09-07 12:10:09 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2004-09-07 12:10:09 +0000 |
commit | da03183935ea75f28e378ff3cfe1cfa5c9052929 (patch) | |
tree | c58402d0201f0a49a14808f2afc3da5b7faa7707 /bin | |
parent | 94ed8f64aecea4ea35b74781c6e7bb895cec77cd (diff) | |
download | ATCD-da03183935ea75f28e378ff3cfe1cfa5c9052929.tar.gz |
ChangeLogTag: Tue Sep 7 07:08:26 2004 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'bin')
-rw-r--r-- | bin/MakeProjectCreator/modules/BorlandProjectCreator.pm | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/bin/MakeProjectCreator/modules/BorlandProjectCreator.pm b/bin/MakeProjectCreator/modules/BorlandProjectCreator.pm index bb349bf5925..df10ae17ab1 100644 --- a/bin/MakeProjectCreator/modules/BorlandProjectCreator.pm +++ b/bin/MakeProjectCreator/modules/BorlandProjectCreator.pm @@ -52,6 +52,41 @@ sub fill_value { ## Sort the directories to ensure that '.' comes first $value = join(';', sort keys %dirnames); } + elsif ($name eq 'relwd') { + my($expenv) = $self->get_expand_env(); + my($rel) = ($expenv ? \%ENV : $self->get_relative()); + $value = $self->getcwd(); + + foreach my $key (keys %$rel) { + ## Do not use PWD or CD if we are expanding environment variables. + ## They could conflict with the "real" values we're looking for. + if ($expenv && ($key eq 'PWD' || $key eq 'CD')) { + next; + } + + ## Get the relative replacement value and convert back-slashes + my($val) = $$rel{$key}; + $val =~ s/\\/\//g; + + ## We only need to check for reverse replacement if the length + ## of the string is less than or equal to the length of our + ## replacement value or the string has a slash at the position + ## of the length of the replacement value + my($vlen) = length($val); + if (length($value) <= $vlen || substr($value, $vlen, 1) eq '/') { + ## Cut the string down by the length of the replacement value + my($lval) = substr($value, 0, $vlen); + + ## Here we make an assumption that we + ## have a case-insensitive file system. + if (lc($lval) eq lc($val)) { + substr($value, 0, length($val) + 1) = ''; + last; + } + } + } + $value = $self->slash_to_backslash($value); + } return $value; } |