diff mbox

lib: fwts_log_xml: wrap up the unclosed tags

Message ID 1338538797-25654-1-git-send-email-kengyu@canonical.com
State Rejected
Headers show

Commit Message

Keng-Yu Lin June 1, 2012, 8:19 a.m. UTC
wrapping up all the remaining unclosed tags in fwts_log_close_xml().

Signed-off-by: Keng-Yu Lin <kengyu@canonical.com>
---
 src/lib/src/fwts_log_xml.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Ivan Hu June 1, 2012, 8:45 a.m. UTC | #1
On 06/01/2012 04:19 PM, Keng-Yu Lin wrote:
> wrapping up all the remaining unclosed tags in fwts_log_close_xml().
>
> Signed-off-by: Keng-Yu Lin<kengyu@canonical.com>
> ---
>   src/lib/src/fwts_log_xml.c |    3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_log_xml.c b/src/lib/src/fwts_log_xml.c
> index 57b530b..0d738e4 100644
> --- a/src/lib/src/fwts_log_xml.c
> +++ b/src/lib/src/fwts_log_xml.c
> @@ -169,7 +169,8 @@ static void fwts_log_open_xml(fwts_log *log)
>
>   static void fwts_log_close_xml(fwts_log *log)
>   {
> -	fwts_log_section_end_xml(log);
> +	while (xml_stack_index)
> +		fwts_log_section_end_xml(log);
>
>   	fwrite("\n", 1, 1, log->fp);
>   	fflush(log->fp);
Acked-by: Ivan Hu<ivan.hu@canonical.com>
Colin Ian King June 1, 2012, 8:51 a.m. UTC | #2
On 01/06/12 09:19, Keng-Yu Lin wrote:
> wrapping up all the remaining unclosed tags in fwts_log_close_xml().
>
> Signed-off-by: Keng-Yu Lin <kengyu@canonical.com>
> ---
>   src/lib/src/fwts_log_xml.c |    3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_log_xml.c b/src/lib/src/fwts_log_xml.c
> index 57b530b..0d738e4 100644
> --- a/src/lib/src/fwts_log_xml.c
> +++ b/src/lib/src/fwts_log_xml.c
> @@ -169,7 +169,8 @@ static void fwts_log_open_xml(fwts_log *log)
>
>   static void fwts_log_close_xml(fwts_log *log)
>   {
> -	fwts_log_section_end_xml(log);
> +	while (xml_stack_index)
> +		fwts_log_section_end_xml(log);
>
>   	fwrite("\n", 1, 1, log->fp);
>   	fflush(log->fp);
>

I think that if we need to force pop these off the stack then we've 
actually got a bug higher up in the framework, so I think that needs 
fixing rather that force popping this stack.  If we force pop these off 
the stack than the tags aren't going to match in the correct places 
anyhow, so... NACK from me.
diff mbox

Patch

diff --git a/src/lib/src/fwts_log_xml.c b/src/lib/src/fwts_log_xml.c
index 57b530b..0d738e4 100644
--- a/src/lib/src/fwts_log_xml.c
+++ b/src/lib/src/fwts_log_xml.c
@@ -169,7 +169,8 @@  static void fwts_log_open_xml(fwts_log *log)
 
 static void fwts_log_close_xml(fwts_log *log)
 {
-	fwts_log_section_end_xml(log);
+	while (xml_stack_index)
+		fwts_log_section_end_xml(log);
 
 	fwrite("\n", 1, 1, log->fp);
 	fflush(log->fp);