diff options
author | Nick Bofferding <bofferdn@us.ibm.com> | 2012-10-16 15:28:11 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-10-24 10:04:09 -0500 |
commit | 054e5219b3c18f11e6a97f9e264513a01f50486e (patch) | |
tree | 825ba2de0c4bb54e96948313e2c36b7729f5ee48 /src/usr/targeting/common/xmltohb/xmltohb.pl | |
parent | 1aff4e6a3cd4c3089765b06f4bc187d7aff6a99f (diff) | |
download | talos-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-x | src/usr/targeting/common/xmltohb/xmltohb.pl | 20 |
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 |