aboutsummaryrefslogtreecommitdiff
path: root/init/init.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-01-29 09:56:21 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-01-29 09:56:21 +0000
commitc882f341cec8451ee87af6746abb7208272d5b1a (patch)
tree5d4ebbf08e8dae6c649e1ca47f0d59911313a89b /init/init.c
parent8c638cbf09363388fd9e523d46ee412425754a6a (diff)
downloadbusybox-w32-c882f341cec8451ee87af6746abb7208272d5b1a.tar.gz
busybox-w32-c882f341cec8451ee87af6746abb7208272d5b1a.tar.bz2
busybox-w32-c882f341cec8451ee87af6746abb7208272d5b1a.zip
init: allow last line to be not terminated by '\n'
Diffstat (limited to 'init/init.c')
-rw-r--r--init/init.c6
1 files changed, 3 insertions, 3 deletions
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)
756 756
757 /* Skip leading spaces */ 757 /* Skip leading spaces */
758 id = skip_whitespace(buf); 758 id = skip_whitespace(buf);
759 /* Skip the line if it's a comment */
760 if (*id == '#' || *id == '\n')
761 continue;
762 /* Trim the trailing '\n' */ 759 /* Trim the trailing '\n' */
763 *strchrnul(id, '\n') = '\0'; 760 *strchrnul(id, '\n') = '\0';
761 /* Skip the line if it is a comment */
762 if (*id == '#' || *id == '\0')
763 continue;
764 764
765 /* Line is: "id:runlevel_ignored:action:command" */ 765 /* Line is: "id:runlevel_ignored:action:command" */
766 runlev = strchr(id, ':'); 766 runlev = strchr(id, ':');