Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Feb 2015 17:56:25 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r278590 - head/usr.bin/wc
Message-ID:  <201502111756.t1BHuPmD027165@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Wed Feb 11 17:56:24 2015
New Revision: 278590
URL: https://svnweb.freebsd.org/changeset/base/278590

Log:
  Close the file list before opening the container that holds the
  totals, otherwise we end up emitting invalid JSON -- provided
  libxo does not prevent us from doing that.
  
  PR:		197499
  Submitted by:	allanjude@

Modified:
  head/usr.bin/wc/wc.c

Modified: head/usr.bin/wc/wc.c
==============================================================================
--- head/usr.bin/wc/wc.c	Wed Feb 11 17:46:35 2015	(r278589)
+++ head/usr.bin/wc/wc.c	Wed Feb 11 17:56:24 2015	(r278590)
@@ -140,12 +140,14 @@ main(int argc, char *argv[])
 		} while(*++argv);
 	}
 
+	xo_close_list("file");
+
 	if (total > 1) {
 		xo_open_container("total");
 		show_cnt("total", tlinect, twordct, tcharct, tlongline);
 		xo_close_container("total");
 	}
-	xo_close_list("file");
+
 	xo_close_container("wc");
 	xo_finish();
 	exit(errors == 0 ? 0 : 1);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502111756.t1BHuPmD027165>