From d006f38d528637fea1d9fc2a5197914119ca63fc Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Sun, 1 Sep 2019 09:57:59 +0200 Subject: [021#2] Fix names --- 021/ch2.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/021/ch2.pl b/021/ch2.pl index a3970a2..e6c11ff 100755 --- a/021/ch2.pl +++ b/021/ch2.pl @@ -38,8 +38,8 @@ sub decode_octet { # Decoding percent-encoded octets of unreserved characters $url =~ s<%[a-zA-Z0-9]{2}>< decode_octet($&) >ge; -my ($scheme, $host, $port, $path) = $url =~ - m<^$scheme_re://$host_re$port_re$rest_re>; +my ($scheme, $host, $port, $rest) = $url =~ + m<^$scheme_re://$host_re$port_re$rest_re$>; die "Unable to decode URI" unless $scheme and $host; @@ -55,8 +55,8 @@ if (!$port || $scheme eq 'http' && $port == 80 || $scheme eq 'https' && $port == } # Removing dot-segments -$path =~ sg; # Remove all '.' -$path =~ s<>g; # Remove instances of the pattern: '/x/..' -$path =~ s<(\.\./)+><>g; # Remove all '..'s left at the beginning +$rest =~ sg; # Remove all '.' +$rest =~ s<>g; # Remove instances of the pattern: '/x/..' +$rest =~ s<(\.\./)+><>g; # Remove all '..'s left at the beginning -print "$scheme://$host$port$path\n"; +print "$scheme://$host$port$rest\n"; -- cgit v1.2.3