Subversion Repositories DevTools

Rev

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

Rev 2438 Rev 2449
Line 417... Line 417...
417
#                   If an absolute path is provided then it will simply be
417
#                   If an absolute path is provided then it will simply be
418
#                   cleaned up.
418
#                   cleaned up.
419
#
419
#
420
# Assumption      : Absolute paths start with a "/" and do not have a drive letter
420
# Assumption      : Absolute paths start with a "/" and do not have a drive letter
421
#
421
#
422
# Inputs          : Source file path
422
# Inputs          : $dpath      - Source file path
423
#                   $here       - Optional current directory
423
#                   $here       - Optional current directory
424
#                                 $Cwd will be used if non provided
424
#                                 $Cwd will be used if non provided
-
 
425
#                   $mode       - Defined: No error
-
 
426
#                                 Used during error reporting
425
#
427
#
426
# Returns         : Cleaned abs path
428
# Returns         : Cleaned abs path
427
#
429
#
428
sub AbsPath
430
sub AbsPath
429
{
431
{
430
    my ($dpath, $here) = @_;
432
    my ($dpath, $here, $mode) = @_;
431
    my @result;
433
    my @result;
432
 
434
 
433
    #
435
    #
434
    #   If we have a relative path then prepend the current directory
436
    #   If we have a relative path then prepend the current directory
435
    #   An absolute path is:
437
    #   An absolute path is:
Line 453... Line 455...
453
        {
455
        {
454
            push @result, $_;
456
            push @result, $_;
455
        }
457
        }
456
        else
458
        else
457
        {
459
        {
-
 
460
            if ( $#result <= 0 )
-
 
461
            {
458
            Error ("Bad Pathname: $dpath")
462
                Error ("Bad Pathname: $dpath") unless ( $mode );
459
                if ( $#result <= 0 );
463
                return $dpath;
-
 
464
            }
-
 
465
            else
-
 
466
            {
460
            pop @result;
467
                pop @result;
-
 
468
            }
461
        }
469
        }
462
    }
470
    }
463
 
471
 
464
    #
472
    #
465
    #   Create a nice directory name again.
473
    #   Create a nice directory name again.