svnno****@sourc*****
svnno****@sourc*****
Sat Jun 2 12:18:13 JST 2007
Revision: 3224 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=kazehakase&view=rev&rev=3224 Author: kous Date: 2007-06-02 12:18:12 +0900 (Sat, 02 Jun 2007) Log Message: ----------- * src/kz-migemo.c (kz_migemo_get_matched_text): checked weather the regexp is matched or not. Modified Paths: -------------- kazehakase/trunk/ChangeLog kazehakase/trunk/src/kz-migemo.c Modified: kazehakase/trunk/ChangeLog =================================================================== --- kazehakase/trunk/ChangeLog 2007-05-29 14:23:36 UTC (rev 3223) +++ kazehakase/trunk/ChangeLog 2007-06-02 03:18:12 UTC (rev 3224) @@ -1,3 +1,8 @@ +2007-06-02 Kouhei Sutou <kou****@cozmi*****> + + * src/kz-migemo.c (kz_migemo_get_matched_text): checked weather + the regexp is matched or not. + 2007-05-26 Kouhei Sutou <kou****@cozmi*****> * src/utils/gregex.[ch]: updated the current GRegex. Modified: kazehakase/trunk/src/kz-migemo.c =================================================================== --- kazehakase/trunk/src/kz-migemo.c 2007-05-29 14:23:36 UTC (rev 3223) +++ kazehakase/trunk/src/kz-migemo.c 2007-06-02 03:18:12 UTC (rev 3224) @@ -202,14 +202,17 @@ return NULL; } - g_regex_match(regex, body, 0, &match_info); - while (g_match_info_next(match_info, NULL)) + if (g_regex_match(regex, body, 0, &match_info)) { - if (matched_text) - g_free(matched_text); - matched_text = g_match_info_fetch(match_info, 0); - if (!last) break; + while (g_match_info_next(match_info, NULL)) + { + if (matched_text) + g_free(matched_text); + matched_text = g_match_info_fetch(match_info, 0); + if (!last) break; + } } + g_match_info_free(match_info); g_regex_free(regex); return matched_text;