print_property_string: don't print the default key's name

We had this behavior in the past and didn't mean to change
it.
This commit is contained in:
Wolfgang Bumiller 2016-05-19 11:33:45 +02:00 committed by Dietmar Maurer
parent 32f8e0c75b
commit 971353e8ac

View File

@ -1601,7 +1601,7 @@ sub print_property_string {
my $done = { map { $_ => 1 } @$skip };
my $cond_add_key = sub {
my ($key) = @_;
my ($key, $isdefault) = @_;
return if $done->{$key}; # avoid duplicates
@ -1633,11 +1633,15 @@ sub print_property_string {
die "internal error" if defined($phash->{alias});
my $value_str = &$format_value($key, $value, $phash->{format});
&$add_option_string("$key=${value_str}");
if ($isdefault) {
&$add_option_string($value_str);
} else {
&$add_option_string("$key=${value_str}");
}
};
# add default key first
&$cond_add_key($default_key) if defined($default_key);
&$cond_add_key($default_key, 1) if defined($default_key);
# add required keys first
foreach my $key (sort keys %$data) {