summaryrefslogtreecommitdiffstats
path: root/perl-install/printer
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/printer')
-rw-r--r--perl-install/printer/main.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/perl-install/printer/main.pm b/perl-install/printer/main.pm
index 5bd467b03..87b5b0c6f 100644
--- a/perl-install/printer/main.pm
+++ b/perl-install/printer/main.pm
@@ -717,7 +717,7 @@ sub read_location {
my $location_end = -1;
# Go through all the lines, bail out when start and end line found
for (my $i = 0;
- $i <= $#{$cupsd_conf_ptr};
+ $i <= $#{$cupsd_conf_ptr} and $location_end == -1;
$i++) {
if ($cupsd_conf_ptr->[$i] =~ m!^\s*<\s*Location\s+$path\s*>!) {
# Start line of block
@@ -760,7 +760,7 @@ sub rip_location {
if (any { m!^\s*<Location\s+$path\s*>! } @$cupsd_conf_ptr) {
# Go through all the lines, bail out when start and end line found
for (my $i = 0;
- $i <= $#{$cupsd_conf_ptr} == -1;
+ $i <= $#{$cupsd_conf_ptr} and $location_end == -1;
$i++) {
if ($cupsd_conf_ptr->[$i] =~ m!^\s*<\s*Location\s+$path\s*>!) {
# Start line of block