Fix collapse-pairs for last empty property
If the last token in the argument for collapse-pairs is
key=, then the following lines were written:
key
=
This patch fixes it so that key= is written instead.
Test: specify ro.boot.logical_partitions= at the end of
ADDITIONAL_PRODUCT_PROPERTIES and `cat $OUT/product/build.prop`
shows:
ro.boot.logical_partitions=
Change-Id: I33a0efb59871f0e36a93c8fae0d75f2735994301
diff --git a/core/definitions.mk b/core/definitions.mk
index 1550206..3512598 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -796,8 +796,8 @@
define collapse-pairs
$(eval _cpSEP := $(strip $(if $(2),$(2),=)))\
-$(subst $(space)$(_cpSEP)$(space),$(_cpSEP),$(strip \
- $(subst $(_cpSEP), $(_cpSEP) ,$(1))))
+$(strip $(subst $(space)$(_cpSEP)$(space),$(_cpSEP),$(strip \
+ $(subst $(_cpSEP), $(_cpSEP) ,$(1)))$(space)))
endef
###########################################################