summaryrefslogtreecommitdiffstats
path: root/src/usr/targeting/common/xmltohb/xmltohb.pl
diff options
context:
space:
mode:
authorNick Bofferding <bofferdn@us.ibm.com>2012-10-16 15:28:11 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-10-24 10:04:09 -0500
commit054e5219b3c18f11e6a97f9e264513a01f50486e (patch)
tree825ba2de0c4bb54e96948313e2c36b7729f5ee48 /src/usr/targeting/common/xmltohb/xmltohb.pl
parent1aff4e6a3cd4c3089765b06f4bc187d7aff6a99f (diff)
downloadtalos-hostboot-054e5219b3c18f11e6a97f9e264513a01f50486e.tar.gz
talos-hostboot-054e5219b3c18f11e6a97f9e264513a01f50486e.zip
Fix array attribute serialization
- Stripped off whitespace from individual array values prior to serializing - Stripped off whitespace from attribute as a whole prior to serializing Change-Id: I02a99ec4121ca6cf9213b84cf60d2a324632cfe5 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2069 Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com> Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/targeting/common/xmltohb/xmltohb.pl')
-rwxr-xr-xsrc/usr/targeting/common/xmltohb/xmltohb.pl20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/usr/targeting/common/xmltohb/xmltohb.pl b/src/usr/targeting/common/xmltohb/xmltohb.pl
index 3cc0e420c..3ea0493d9 100755
--- a/src/usr/targeting/common/xmltohb/xmltohb.pl
+++ b/src/usr/targeting/common/xmltohb/xmltohb.pl
@@ -2362,6 +2362,18 @@ sub sizeBlockAligned {
}
################################################################################
+# Strips off leading and trailing whitespace from a string and returns it
+################################################################################
+
+sub stripLeadingAndTrailingWhitespace {
+ my($string) = @_;
+
+ $string =~ s/^\s+|\s+$//g;
+
+ return $string;
+}
+
+################################################################################
# Optimize white space for C++/doxygen documentation
################################################################################
@@ -3180,6 +3192,8 @@ sub packSingleSimpleTypeAttribute {
sub packAttribute {
my($attributes,$attribute,$value) = @_;
+ $value = stripLeadingAndTrailingWhitespace($value);
+
my $binaryData;
my $alignment = 1;
@@ -3219,8 +3233,10 @@ sub packAttribute {
{
if ($i < $valueArraySize)
{
- # Get the value from the value array
- $val = $values[$i];
+ # Get the value from the value array and strip any
+ # remaining leading/trailing whitespace that
+ # surrounded the value after the original split
+ $val = stripLeadingAndTrailingWhitespace($values[$i]);
}
# else use the last value
OpenPOWER on IntegriCloud