- Minor fixes to writeConfig().

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2002 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Mark Buechler
2010-08-25 19:59:30 +00:00
parent 92467af270
commit 2011e50e47

View File

@@ -916,6 +916,8 @@ sub writeConfiguration {
my $attributes = $SCST->scstAttributes();
immediateExit($SCST->errorString());
my %nattrs;
foreach my $attribute (sort keys %{$attributes}) {
next if (defined($$attributes{$attribute}->{'set'}));
@@ -930,12 +932,20 @@ sub writeConfiguration {
} elsif ($nonkey) {
my $value = $$attributes{$attribute}->{'value'};
$value = "\"$value\"" if ($value =~ / /);
print $io "$attribute $value\n"
$nattrs{$attribute} = $value
if (defined($value) && ($value ne ''));
}
}
}
if ($nonkey && (scalar keys %nattrs)) {
print $io "# Non-key attributes\n";
foreach my $attr (keys %nattrs) {
my $value = $nattrs{$attr};
print $io "$attr $value\n";
}
}
print $io "\n";
foreach my $handler (sort keys %{$CURRENT{'handler'}}) {
@@ -1034,7 +1044,7 @@ sub writeConfiguration {
}
if ($attribute_buff_nk) {
$attribute_buff .= "\t\t# Non-key attributes\n";
$attribute_buff .= "\n\t\t# Non-key attributes\n";
$attribute_buff .= $attribute_buff_nk;
}