From owner-svn-src-all@FreeBSD.ORG Fri Nov 7 01:36:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13BF5B6F; Fri, 7 Nov 2014 01:36:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 003DA71; Fri, 7 Nov 2014 01:36:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA71aKq9000272; Fri, 7 Nov 2014 01:36:20 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA71aKJm000271; Fri, 7 Nov 2014 01:36:20 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201411070136.sA71aKJm000271@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 7 Nov 2014 01:36:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274210 - head/usr.bin/wc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 01:36:21 -0000 Author: marcel Date: Fri Nov 7 01:36:20 2014 New Revision: 274210 URL: https://svnweb.freebsd.org/changeset/base/274210 Log: Fix a SIGSEGV when emitting XML or JSON when reading stdin. In that case the file variable is NULL. Modified: head/usr.bin/wc/wc.c Modified: head/usr.bin/wc/wc.c ============================================================================== --- head/usr.bin/wc/wc.c Fri Nov 7 00:59:40 2014 (r274209) +++ head/usr.bin/wc/wc.c Fri Nov 7 01:36:20 2014 (r274210) @@ -164,8 +164,6 @@ show_cnt(const char *file, uintmax_t lin siginfo = 0; } - xo_emit("{ek:filename/%s}", file); - if (doline) xo_emit_h(xop, " {:lines/%7ju/%ju}", linect); if (doword) @@ -175,7 +173,7 @@ show_cnt(const char *file, uintmax_t lin if (dolongline) xo_emit_h(xop, " {:long-lines/%7ju/%ju}", llct); if (file != NULL) - xo_emit_h(xop, " {d:filename/%s}\n", file); + xo_emit_h(xop, " {:filename/%s}\n", file); else xo_emit_h(xop, "\n"); }