~ubuntu-branches/ubuntu/saucy/opencc/saucy-proposed

« back to all changes in this revision

Viewing changes to src/dictionary/text.c

  • Committer: Package Import Robot
  • Author(s): Asias He
  • Date: 2013-04-05 10:52:29 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20130405105229-fiif4biajh42hkyg
Tags: 0.4.0-1
* New upstream release
* fix-new-test-cases.patch in upstream
* part of more_clear_man_c_option.patch is in upstream
  the rest is in install-data-file-to-meet-need-of-multi-arch.path

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
                        );
73
73
                }
74
74
 
75
 
                for (buff = ++ pbuff; *pbuff != ' ' && *pbuff != '\0' && *pbuff != '\n'; ++ pbuff)
 
75
                for (buff = ++ pbuff; *pbuff != ' ' && *pbuff != '\0' && *pbuff != '\n' && *pbuff != '\r'; ++ pbuff)
76
76
                        ;
77
77
                length = pbuff - buff;
78
78
                ucs4_buff = utf8_to_ucs4(buff, length);
112
112
 
113
113
        static char buff[ENTRY_BUFF_SIZE];
114
114
 
115
 
        FILE * fp = fopen(filename,"rb");
 
115
        FILE * fp = fopen(filename,"r");
116
116
        if (fp == NULL)
117
117
        {
118
118
                dictionary_text_close((dictionary_t) text_dictionary);
119
119
                return (dictionary_t) -1;
120
120
        }
 
121
        skip_utf8_bom(fp);
121
122
 
122
123
        size_t i = 0;
123
124
        while (fgets(buff, ENTRY_BUFF_SIZE, fp))