mirror of
https://github.com/sheumann/hush.git
synced 2025-01-03 00:31:16 +00:00
init: allow last line to be not terminated by '\n'
This commit is contained in:
parent
8c638cbf09
commit
c882f341ce
@ -756,11 +756,11 @@ static void parse_inittab(void)
|
|||||||
|
|
||||||
/* Skip leading spaces */
|
/* Skip leading spaces */
|
||||||
id = skip_whitespace(buf);
|
id = skip_whitespace(buf);
|
||||||
/* Skip the line if it's a comment */
|
|
||||||
if (*id == '#' || *id == '\n')
|
|
||||||
continue;
|
|
||||||
/* Trim the trailing '\n' */
|
/* Trim the trailing '\n' */
|
||||||
*strchrnul(id, '\n') = '\0';
|
*strchrnul(id, '\n') = '\0';
|
||||||
|
/* Skip the line if it is a comment */
|
||||||
|
if (*id == '#' || *id == '\0')
|
||||||
|
continue;
|
||||||
|
|
||||||
/* Line is: "id:runlevel_ignored:action:command" */
|
/* Line is: "id:runlevel_ignored:action:command" */
|
||||||
runlev = strchr(id, ':');
|
runlev = strchr(id, ':');
|
||||||
|
Loading…
Reference in New Issue
Block a user