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:
parent
8d61f393a3
commit
0ce97bdf81
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=268278
@ -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.
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user