summaryrefslogtreecommitdiff
path: root/hangul/hanja.c
diff options
context:
space:
mode:
authorChoe Hwanjin <choe.hwanjin@gmail.com>2006-02-18 11:13:18 +0900
committerChoe Hwanjin <choe.hwanjin@gmail.com>2006-02-18 11:13:18 +0900
commita8eeebba20f1f9b0f4f5dd8519dd95f336d85c40 (patch)
tree9a07c3b2267657fb9937e7eb226009540a4ffd03 /hangul/hanja.c
parentf2a1b47a89726c2dea0e1871ced91a5d18715737 (diff)
downloadlibhangul-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.c4
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);