From a8eeebba20f1f9b0f4f5dd8519dd95f336d85c40 Mon Sep 17 00:00:00 2001 From: Choe Hwanjin Date: Sat, 18 Feb 2006 11:13:18 +0900 Subject: ignore comment line which is started by '#' or blank line git-svn-id: http://kldp.net/svn/hangul/libhangul/trunk@55 8f00fcd2-89fc-0310-932e-b01be5b65e01 --- hangul/hanja.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hangul/hanja.c') diff --git a/hangul/hanja.c b/hangul/hanja.c index 80ee6ea..ccaa5f6 100644 --- a/hangul/hanja.c +++ b/hangul/hanja.c @@ -193,6 +193,10 @@ hanja_table_load(const char *filename) } while (fgets(buf, sizeof(buf), file) != NULL) { + /* skip comments and empty lines */ + if (buf[0] == '#' || buf[0] == '\r' || buf[0] == '\n' || buf[0] == '\0') + continue; + save_ptr = NULL; key = strtok_r(buf, ":", &save_ptr); value = strtok_r(NULL, ":", &save_ptr); -- cgit v1.2.1