Kouhei Sutou
null+****@clear*****
Wed Nov 7 14:47:44 JST 2012
Kouhei Sutou 2012-11-07 14:47:44 +0900 (Wed, 07 Nov 2012) New Revision: 8fa1e5e11a040f365a54652f5d81da1bc2d057cf https://github.com/groonga/groonga/commit/8fa1e5e11a040f365a54652f5d81da1bc2d057cf Log: Add GRN_SNIP_MAPPING_HTML_ESCAPE to be readable Modified files: include/groonga.h lib/snip.c Modified: include/groonga.h (+2 -0) =================================================================== --- include/groonga.h 2012-11-07 13:21:44 +0900 (be286e5) +++ include/groonga.h 2012-11-07 14:47:44 +0900 (d83e1db) @@ -2002,6 +2002,8 @@ struct _grn_snip_mapping { #define GRN_SNIP_COPY_TAG (0x01<<1) #define GRN_SNIP_SKIP_LEADING_SPACES (0x01<<2) +#define GRN_SNIP_MAPPING_HTML_ESCAPE ((grn_snip_mapping *)-1) + /* grn_snip_open() should return grn_obj * instead. * TODO: 3.0 */ GRN_API grn_snip *grn_snip_open(grn_ctx *ctx, int flags, unsigned int width, Modified: lib/snip.c (+1 -1) =================================================================== --- lib/snip.c 2012-11-07 13:21:44 +0900 (ffadc90) +++ lib/snip.c 2012-11-07 14:47:44 +0900 (38c2c89) @@ -756,7 +756,7 @@ grn_snip_get_result(grn_ctx *ctx, grn_snip *snip, const unsigned int index, char p += snip->tag_result[j].cond->opentag_len; } - if (snip->mapping == (grn_snip_mapping *) -1) { + if (snip->mapping == GRN_SNIP_MAPPING_HTML_ESCAPE) { switch (snip->string[i]) { case '<': *p++ = '&'; -------------- next part -------------- HTML����������������������������... 下載