From 1ea67378f1797c82699a8cf39c7b7cb1fb77c0a4 Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Sat, 29 Jan 2022 17:42:09 +0800 Subject: [PATCH] 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 --- misc/config_tools/xforms/config.h.xsl | 3 ++- misc/config_tools/xforms/config.mk.xsl | 2 +- misc/config_tools/xforms/config_common.xsl | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/misc/config_tools/xforms/config.h.xsl b/misc/config_tools/xforms/config.h.xsl index 4255056db..05f431a8d 100644 --- a/misc/config_tools/xforms/config.h.xsl +++ b/misc/config_tools/xforms/config.h.xsl @@ -49,7 +49,8 @@ - + + diff --git a/misc/config_tools/xforms/config.mk.xsl b/misc/config_tools/xforms/config.mk.xsl index d0176c7eb..a08b69ea8 100644 --- a/misc/config_tools/xforms/config.mk.xsl +++ b/misc/config_tools/xforms/config.mk.xsl @@ -43,7 +43,7 @@ - + diff --git a/misc/config_tools/xforms/config_common.xsl b/misc/config_tools/xforms/config_common.xsl index 53ee27da6..8f8999b25 100644 --- a/misc/config_tools/xforms/config_common.xsl +++ b/misc/config_tools/xforms/config_common.xsl @@ -329,7 +329,7 @@ - +