94 |
|
|
95 |
|
my $rv=1; |
96 |
|
# -- can only merge url's of the same type |
97 |
< |
if ( $self->type() eq $url->type() ) { |
97 |
> |
if ( (defined $url) && ($self->type() eq $url->type()) ) { |
98 |
|
# -- merge server only if it dosnt exist locally |
99 |
|
if ( (! defined $self->{servername}) || ($self->{servername} eq "") ) { |
100 |
|
$self->servername($url->servername()); |
201 |
|
my $self=shift; |
202 |
|
my $url=shift; |
203 |
|
|
204 |
+ |
if ( $url!~/:/ ) { |
205 |
+ |
$self->error("Invalid URL specification - no type: in $url"); |
206 |
+ |
} |
207 |
+ |
else { |
208 |
|
# -- split out type and lowercase it |
209 |
|
my ($type, @rest)= split ":", $url; |
210 |
|
($self->{type}=$type)=~tr[A-Z][a-z]; |
216 |
|
if ( $varstring ) { $self->_splitvarstring($varstring);} |
217 |
|
|
218 |
|
# -- extract servername from path |
219 |
< |
if ( $path=~/^\/\// ) { |
219 |
> |
if ( ! defined $path ) { |
220 |
> |
$path=""; |
221 |
> |
} |
222 |
> |
elsif ( $path=~/^\/\// ) { |
223 |
|
my $server; |
224 |
|
($server,$path)=($path=~/^\/\/(.*?)\/(.*)/); |
225 |
|
$self->servername($server); |
226 |
|
} |
227 |
|
$self->path($path); |
228 |
+ |
} |
229 |
+ |
} |
230 |
+ |
|
231 |
+ |
sub error { |
232 |
+ |
my $self=shift; |
233 |
+ |
my $string=shift; |
234 |
+ |
print "URLClass: ".$string."\n"; |
235 |
+ |
die; |
236 |
|
} |