summaryrefslogtreecommitdiffstats
path: root/drakpxelinux.pl
diff options
context:
space:
mode:
Diffstat (limited to 'drakpxelinux.pl')
-rw-r--r--drakpxelinux.pl12
1 files changed, 4 insertions, 8 deletions
diff --git a/drakpxelinux.pl b/drakpxelinux.pl
index f55d966..13586a5 100644
--- a/drakpxelinux.pl
+++ b/drakpxelinux.pl
@@ -283,13 +283,9 @@ sub remove_item {
}
sub test_similar_label {
- my ($newlabel, $oldlabel) = @_;
-# if ($newlabel eq $oldlabel) {
-# err_dialog(N("hmm.."), N("You should provide a new label name.")) and return 0;
-# } els
-
- if (any { $_->{label} eq $newlabel } @{$pxelinux_conf->{entries}}) {
- err_dialog(N("Error!"), N("Found a similar entry in PXE list labeled: %s.\nChoose another label please", $newlabel)) and return 0;
+ my ($label) = @_;
+ if (any { $_->{label} eq $label } @{$pxelinux_conf->{entries}}) {
+ err_dialog(N("Error!"), N("Found a similar entry in PXE list labeled: %s.\nChoose another label please", $label)) and return 0;
} else { return 1 }
}
@@ -537,7 +533,7 @@ sub cell_edited {
my $oldlabel = $entry->{label};
my $newlabel = $new_text;
- if (test_similar_label($newlabel, $oldlabel) eq "1") {
+ if ($newlabel ne $oldlabel && test_similar_label($newlabel)) {
network::pxe::change_label_in_help($oldlabel, $newlabel);
$entry->{label} = $new_text;
$model->set($iter, $column, $entry->{label});