From 71172f66592ef942ad4a092adff54180a699269d Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Tue, 8 May 2007 22:44:51 +0200 Subject: [PATCH] src/types_list.c: Strip newlines from the end of the line. --- src/types_list.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/types_list.c b/src/types_list.c index 3963897e..002761ce 100644 --- a/src/types_list.c +++ b/src/types_list.c @@ -158,6 +158,13 @@ static void parse_file (FILE *fh) if ((buf_len == 0) || (buf[0] == '#')) continue; + while ((buf_len > 0) && ((buf[buf_len - 1] == '\n') + || (buf[buf_len - 1] == '\n'))) + buf[--buf_len] = '\0'; + + if (buf_len == 0) + continue; + parse_line (buf, buf_len); } /* while (fgets) */ } /* void parse_file */ -- 2.30.2