mirror of
https://github.com/troglobit/finit.git
synced 2026-11-06 15:51:03 +00:00
Chomp trailing LF in line from conf file
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
This commit is contained in:
1 parent
01509376cc
commit
75d755afad
1 file changed
+5
-3
+5
-3
@@ -162,9 +162,11 @@ int main()
|
|||||||
while (!feof(f)) {
|
while (!feof(f)) {
|
||||||
fgets(line, LINE_SIZE, f);
|
fgets(line, LINE_SIZE, f);
|
||||||
|
|
||||||
if (debug) {
|
if (line[i = strlen(line)] == '\n')
|
||||||
printf("conf: %s", line);
|
line[i] = 0;
|
||||||
}
|
|
||||||
|
if (debug)
|
||||||
|
printf("conf: %s\n", line);
|
||||||
|
|
||||||
if ((x = strstr(line, "check ")) == line) {
|
if ((x = strstr(line, "check ")) == line) {
|
||||||
x += 6;
|
x += 6;
|
||||||
|
|||||||
Reference in new issue
Block a user