From owner-svn-src-all@FreeBSD.ORG Sat Jul 5 03:25:27 2014 Return-Path: Delivered-To: svn-src-all@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 8DB66D3A; Sat, 5 Jul 2014 03:25:27 +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 7B2E42EB3; Sat, 5 Jul 2014 03:25:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s653PR3i066630; Sat, 5 Jul 2014 03:25:27 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s653PRqE066628; Sat, 5 Jul 2014 03:25:27 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201407050325.s653PRqE066628@svn.freebsd.org> From: Eitan Adler Date: Sat, 5 Jul 2014 03:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268278 - head/usr.bin/units 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 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: Sat, 05 Jul 2014 03:25:27 -0000 Author: eadler Date: Sat Jul 5 03:25:26 2014 New Revision: 268278 URL: http://svnweb.freebsd.org/changeset/base/268278 Log: units: Support start of line comments with '#' Modern GNU units(1) supports comments anywhere with '#' but take the easy route for now and at least support start of line # comments. Modified: head/usr.bin/units/units.1 head/usr.bin/units/units.c Modified: head/usr.bin/units/units.1 ============================================================================== --- head/usr.bin/units/units.1 Sat Jul 5 03:17:57 2014 (r268277) +++ head/usr.bin/units/units.1 Sat Jul 5 03:25:26 2014 (r268278) @@ -149,7 +149,7 @@ The program will not detect infinite loops that could be caused by careless unit definitions. Comments in the unit definition file -begin with a '/' character at the beginning of a line. +begin with a '#' or '/' character at the beginning of a line. .Pp Prefixes are defined in the same was as standard units, but with a trailing dash at the end of the prefix name. Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Sat Jul 5 03:17:57 2014 (r268277) +++ head/usr.bin/units/units.c Sat Jul 5 03:25:26 2014 (r268278) @@ -166,7 +166,7 @@ readunits(const char *userfile) break; linenum++; lineptr = line; - if (*lineptr == '/') + if (*lineptr == '/' || *lineptr == '#') continue; lineptr += strspn(lineptr, " \n\t"); len = strcspn(lineptr, " \n\t");