Subversion Repositories DevTools

Rev

Rev 285 | Rev 361 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 285 Rev 325
Line 415... Line 415...
415
#                   cleaned up.
415
#                   cleaned up.
416
#
416
#
417
# Assumption      : Absolute paths start with a "/" and do not have a drive letter
417
# Assumption      : Absolute paths start with a "/" and do not have a drive letter
418
#
418
#
419
# Inputs          : Source file path
419
# Inputs          : Source file path
-
 
420
#                   $here       - Optional current directory
-
 
421
#                                 $Cwd will be used if non provided
420
#
422
#
421
# Returns         : Cleaned abs path
423
# Returns         : Cleaned abs path
422
#
424
#
423
sub AbsPath
425
sub AbsPath
424
{
426
{
425
    my ($dpath) = @_;
427
    my ($dpath, $here) = @_;
426
    my @result;
428
    my @result;
427
 
429
 
428
    #
430
    #
429
    #   If we have a relative path then prepend the current directory
431
    #   If we have a relative path then prepend the current directory
430
    #   An absolute path is:
432
    #   An absolute path is:
431
    #           /aaa/aa/aa
433
    #           /aaa/aa/aa
432
    #       or  c:/aaa/aa/aa
434
    #       or  c:/aaa/aa/aa
433
    #
435
    #
-
 
436
    $here = $Cwd unless ( defined $here );
434
    $dpath = $Cwd . '/' . $dpath
437
    $dpath = $here . '/' . $dpath
435
        unless ( $dpath =~ m~^/|\w:/~  );
438
        unless ( $dpath =~ m~^/|\w:/~  );
436
    $dpath =~ s~//~/~g;
439
    $dpath =~ s~//~/~g;
437
 
440
 
438
    #
441
    #
439
    #   Walk the bits and remove ".." directories
442
    #   Walk the bits and remove ".." directories
Line 470... Line 473...
470
#
473
#
471
#                   If an absolute path is provided then it will simply be
474
#                   If an absolute path is provided then it will simply be
472
#                   cleaned up.
475
#                   cleaned up.
473
#
476
#
474
# Inputs          : Source file path
477
# Inputs          : Source file path
-
 
478
#                   $here       - Optional current directory
-
 
479
#                                 $Cwd will be used if non provided
475
#
480
#
476
# Returns         : Cleaned abs path
481
# Returns         : Cleaned abs path
477
#
482
#
478
sub FullPath
483
sub FullPath
479
{
484
{