projects
/
oweals
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5735eda
)
inittab: strip trailing whitespace (especially newline)
author
Felix Fietkau
<nbd@openwrt.org>
Sat, 24 May 2014 15:43:45 +0000
(17:43 +0200)
committer
Felix Fietkau
<nbd@openwrt.org>
Sat, 24 May 2014 15:43:45 +0000
(17:43 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
inittab.c
patch
|
blob
|
history
diff --git
a/inittab.c
b/inittab.c
index a9c3535eba506e89c010f84b5199eee457eb3cd0..677ec47cfab886e11b1ccf37cca20deff5713f46 100644
(file)
--- a/
inittab.c
+++ b/
inittab.c
@@
-20,6
+20,7
@@
#include <stdlib.h>
#include <unistd.h>
#include <regex.h>
+#include <ctype.h>
#include <libubox/utils.h>
#include <libubox/list.h>
@@
-258,6
+259,11
@@
void procd_inittab(void)
char *tags[TAG_PROCESS + 1];
char *tok;
int i;
+ int len = strlen(line);
+
+ while (isspace(line[len - 1]))
+ len--;
+ line[len] = 0;
if (*line == '#')
continue;