From owner-svn-src-head@FreeBSD.ORG Wed Mar 12 08:54:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09B33A20; Wed, 12 Mar 2014 08:54:30 +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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EA69CD69; Wed, 12 Mar 2014 08:54:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2C8sTgf079977; Wed, 12 Mar 2014 08:54:29 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2C8sTCx079976; Wed, 12 Mar 2014 08:54:29 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201403120854.s2C8sTCx079976@svn.freebsd.org> From: Poul-Henning Kamp Date: Wed, 12 Mar 2014 08:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263077 - head/usr.bin/ministat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 08:54:30 -0000 Author: phk Date: Wed Mar 12 08:54:29 2014 New Revision: 263077 URL: http://svnweb.freebsd.org/changeset/base/263077 Log: Make ministat CRNL tolerant by stripping all isspace() from the tail end of input lines. Modified: head/usr.bin/ministat/ministat.c Modified: head/usr.bin/ministat/ministat.c ============================================================================== --- head/usr.bin/ministat/ministat.c Wed Mar 12 08:32:01 2014 (r263076) +++ head/usr.bin/ministat/ministat.c Wed Mar 12 08:54:29 2014 (r263077) @@ -13,6 +13,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -475,8 +476,8 @@ ReadSet(const char *n, int column, const line++; i = strlen(buf); - if (buf[i-1] == '\n') - buf[i-1] = '\0'; + while (i > 0 && isspace(buf[i - 1])) + buf[--i] = '\0'; for (i = 1, t = strtok(buf, delim); t != NULL && *t != '#'; i++, t = strtok(NULL, delim)) {