mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-19 20:22:46 +00:00
xforms: fix incorrect comparison against empty strings
In XSL a string variable can be nul, the empty string or a non-empty string. While `$var != ''` ensures that `var` is a non-empty string, `$var = ''` is true only when `var` holds the empty string. In other words, `$var = ''` and `$var != ''` can be both false if `var` evaluates to nul. As a result, the config.h/config.mk generating scripts does not use the given default value if the explicit value is nul. This patch fixes the incorrect comparison in the XSL scripts that handles default values, so that the default value behaves as expected. Tracked-On: #6355 Signed-off-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
parent
5118d67508
commit
1ea67378f1
@ -49,7 +49,8 @@
|
||||
<xsl:value-of select="$value" />
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="($value = '') and ($default != '')">
|
||||
<xsl:when test="$default != ''">
|
||||
<xsl:text> </xsl:text>
|
||||
<xsl:value-of select="$default" />
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:when>
|
||||
|
@ -43,7 +43,7 @@
|
||||
<xsl:value-of select="$value" />
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="($value = '') and ($default != '')">
|
||||
<xsl:when test="$default != ''">
|
||||
<xsl:value-of select="$default" />
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:when>
|
||||
|
@ -329,7 +329,7 @@
|
||||
<xsl:with-param name="value" select="concat($value, $integer-suffix)" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:when test="($value = '') and ($default != '')">
|
||||
<xsl:when test="$default != ''">
|
||||
<xsl:call-template name="entry-by-key-value">
|
||||
<xsl:with-param name="prefix" select="$prefix" />
|
||||
<xsl:with-param name="key" select="$key" />
|
||||
|
Loading…
Reference in New Issue
Block a user