- {
- int j = 0;
- for (i = 0; i<len; i++)
- {
- switch (buf[i]) {
- case '<':
- if (i > j)
- wrbuf_iconv_write(wr, mt->iconv_cd, buf+j, i-j);
- wrbuf_puts(wr, "<");
- j=i+1;
- break;
- case '>':
- if (i > j)
- wrbuf_iconv_write(wr, mt->iconv_cd, buf+j, i-j);
- wrbuf_puts(wr, ">");
- j=i+1;
- break;
- case '&':
- if (i > j)
- wrbuf_iconv_write(wr, mt->iconv_cd, buf+j, i-j);
- wrbuf_puts(wr, "&");
- j=i+1;
- break;
- case '"':
- if (i > j)
- wrbuf_iconv_write(wr, mt->iconv_cd, buf+j, i-j);
- wrbuf_puts(wr, """);
- j=i+1;
- break;
- case '\'':
- if (i > j)
- wrbuf_iconv_write(wr, mt->iconv_cd, buf+j, i-j);
- wrbuf_puts(wr, "'");
- j=i+1;
- break;
- }
- }
- if (i > j)
- wrbuf_iconv_write(wr, mt->iconv_cd, buf+j, i-j);
- }