IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13589


Ignore:
Timestamp:
May 31, 2007, 7:42:14 PM (19 years ago)
Author:
eugene
Message:

allow base to not include a leading /

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-Config/lib/PS/IPP/Config.pm

    r13579 r13589  
    11# Copyright (c) 2006  Paul Price, Joshua Hoblitt
    22#
    3 # $Id: Config.pm,v 1.51 2007-06-01 01:00:26 price Exp $
     3# $Id: Config.pm,v 1.52 2007-06-01 05:42:14 eugene Exp $
    44
    55package PS::IPP::Config;
     
    166166sub caturi
    167167{
    168     my $base = shift;           # Base name (might be "path://SOMETHING" or "neb://SOMETHING")
     168    my $base = shift;           # Base name (might be "foo /foo path://SOMETHING" or "neb://SOMETHING")
    169169    my @segments = @_;          # Path segments
    170170
     171    carp "base is not inited" if not defined $base;
    171172    my ($scheme) = $base =~ m|^(\S+):|; # The scheme, e.g., file://, path://
    172173    $base =~ s|^\S+:/*||;
    173     my $root = '/' if $base =~ m|^/|; # Any root slashes?
     174
     175    my $root = '';
     176    if ($base =~ m|^/|) { $root = '/'; }
    174177
    175178    unshift @segments, $base if $base =~ /\S+/;
Note: See TracChangeset for help on using the changeset viewer.