From 5705531c76a81cab986561a6c1b36d42f4db6287 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Thu, 19 Aug 2004 10:45:36 +0000 Subject: workaround not to call c::upgrade_utf8 on read-only variables --- perl-install/printer/main.pm | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/perl-install/printer/main.pm b/perl-install/printer/main.pm index fbe1ef102..47f589ca7 100644 --- a/perl-install/printer/main.pm +++ b/perl-install/printer/main.pm @@ -350,21 +350,27 @@ sub make_menuentry { $connection = N(", multi-function device"); } } elsif ($connect =~ m!^file:(.+)$!) { - $connection = N(", printing to %s", $1); + my $file = $1; + $connection = N(", printing to %s", $file); } elsif ($connect =~ m!^lpd://([^/]+)/([^/]+)/?$!) { - $connection = N(" on LPD server \"%s\", printer \"%s\"", $1, $2); + my ($server, $printer) = ($1, $2); + $connection = N(" on LPD server \"%s\", printer \"%s\"", $server, $printer); } elsif ($connect =~ m!^socket://([^/:]+):([^/:]+)/?$!) { - $connection = N(", TCP/IP host \"%s\", port %s", $1, $2); + my ($host, $port) = ($1, $2); + $connection = N(", TCP/IP host \"%s\", port %s", $host, $port); } elsif ($connect =~ m!^smb://([^/\@]+)/([^/\@]+)/?$! || $connect =~ m!^smb://.*/([^/\@]+)/([^/\@]+)/?$! || $connect =~ m!^smb://.*\@([^/\@]+)/([^/\@]+)/?$!) { - $connection = N(" on SMB/Windows server \"%s\", share \"%s\"", $1, $2); + my ($server, $share) = ($1, $2); + $connection = N(" on SMB/Windows server \"%s\", share \"%s\"", $server, $share); } elsif ($connect =~ m!^ncp://([^/\@]+)/([^/\@]+)/?$! || $connect =~ m!^ncp://.*/([^/\@]+)/([^/\@]+)/?$! || $connect =~ m!^ncp://.*\@([^/\@]+)/([^/\@]+)/?$!) { - $connection = N(" on Novell server \"%s\", printer \"%s\"", $1, $2); + my ($server, $printer) = ($1, $2); + $connection = N(" on Novell server \"%s\", printer \"%s\"", $server, $printer); } elsif ($connect =~ m!^postpipe:(.+)$!) { - $connection = N(", using command %s", $1); + my $command = $1; + $connection = N(", using command %s", $command); } else { $connection = ($printer->{expert} ? ", URI: $connect" : ""); } @@ -401,22 +407,27 @@ sub connectionstr { $connection = N("Multi-function device"); } } elsif ($connect =~ m!^file:(.+)$!) { - $connection = N("Prints into %s", $1); + my $file = $1; + $connection = N("Prints into %s", $file); } elsif ($connect =~ m!^lpd://([^/]+)/([^/]+)/?$!) { - $connection = N("LPD server \"%s\", printer \"%s\"", $1, $2); + my ($server, $port) = ($1, $2); + $connection = N("LPD server \"%s\", printer \"%s\"", $server, $port); } elsif ($connect =~ m!^socket://([^/:]+):([^/:]+)/?$!) { my ($host, $port) = ($1, $2); $connection = N("TCP/IP host \"%s\", port %s", $host, $port); } elsif ($connect =~ m!^smb://([^/\@]+)/([^/\@]+)/?$! || $connect =~ m!^smb://.*/([^/\@]+)/([^/\@]+)/?$! || $connect =~ m!^smb://.*\@([^/\@]+)/([^/\@]+)/?$!) { - $connection = N("SMB/Windows server \"%s\", share \"%s\"", $1, $2); + my ($server, $share) = ($1, $2); + $connection = N("SMB/Windows server \"%s\", share \"%s\"", $server, $share); } elsif ($connect =~ m!^ncp://([^/\@]+)/([^/\@]+)/?$! || $connect =~ m!^ncp://.*/([^/\@]+)/([^/\@]+)/?$! || $connect =~ m!^ncp://.*\@([^/\@]+)/([^/\@]+)/?$!) { - $connection = N("Novell server \"%s\", printer \"%s\"", $1, $2); + my ($server, $share) = ($1, $2); + $connection = N("Novell server \"%s\", printer \"%s\"", $server, $share); } elsif ($connect =~ m!^postpipe:(.+)$!) { - $connection = N("Uses command %s", $1); + my $command = $1; + $connection = N("Uses command %s", $command); } else { $connection = N("URI: %s", $connect); } -- cgit v1.2.1