1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-29 16:44:03 +00:00

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.
This commit is contained in:
Eitan Adler 2014-07-05 03:25:26 +00:00
parent 8d61f393a3
commit 0ce97bdf81
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=268278
2 changed files with 2 additions and 2 deletions

View File

@ -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.

View File

@ -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");