From: Denis Vlasenko Date: Tue, 29 Jan 2008 09:56:21 +0000 (-0000) Subject: init: allow last line to be not terminated by '\n' X-Git-Tag: 1_10_0~240 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c882f341cec8451ee87af6746abb7208272d5b1a;p=oweals%2Fbusybox.git init: allow last line to be not terminated by '\n' --- diff --git a/init/init.c b/init/init.c index 513ff340c..9e24817b7 100644 --- a/init/init.c +++ b/init/init.c @@ -756,11 +756,11 @@ static void parse_inittab(void) /* Skip leading spaces */ id = skip_whitespace(buf); - /* Skip the line if it's a comment */ - if (*id == '#' || *id == '\n') - continue; /* Trim the trailing '\n' */ *strchrnul(id, '\n') = '\0'; + /* Skip the line if it is a comment */ + if (*id == '#' || *id == '\0') + continue; /* Line is: "id:runlevel_ignored:action:command" */ runlev = strchr(id, ':');