ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/URL/URLclass.pm
(Generate patch)

Comparing COMP/SCRAM/src/URL/URLclass.pm (file contents):
Revision 1.11 by williamc, Fri Jul 28 17:06:00 2000 UTC vs.
Revision 1.12 by williamc, Fri Aug 4 07:47:43 2000 UTC

# Line 94 | Line 94 | sub merge {
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());
# Line 201 | Line 201 | sub _url {
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];
# Line 212 | Line 216 | sub _url {
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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines