diff options
author | Choe Hwanjin <choe.hwanjin@gmail.com> | 2006-02-18 11:13:18 +0900 |
---|---|---|
committer | Choe Hwanjin <choe.hwanjin@gmail.com> | 2006-02-18 11:13:18 +0900 |
commit | a8eeebba20f1f9b0f4f5dd8519dd95f336d85c40 (patch) | |
tree | 9a07c3b2267657fb9937e7eb226009540a4ffd03 /hangul/hanja.c | |
parent | f2a1b47a89726c2dea0e1871ced91a5d18715737 (diff) | |
download | libhangul-a8eeebba20f1f9b0f4f5dd8519dd95f336d85c40.tar.gz |
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
Diffstat (limited to 'hangul/hanja.c')
-rw-r--r-- | hangul/hanja.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); |