• R/O
  • SSH
  • HTTPS

tsukurimashou: Commit


Commit MetaInfo

Revision493 (tree)
Time2013-12-11 06:40:46
Authormskala

Log Message

many new "page" kanji, add filenames to tsukurimashou.eids, cooking bug fix

Change Summary

Incremental Difference

--- trunk/idsgrep/cook.c (revision 492)
+++ trunk/idsgrep/cook.c (revision 493)
@@ -144,7 +144,7 @@
144144 buffered_columns+=idsgrep_utf8cw(cp+i);
145145 while (1) {
146146 wrap_buffer[buffered_bytes++]=cp[i++];
147- if ((cp[i]&0xC0)!=0x80)
147+ if ((i>=len) || ((cp[i]&0xC0)!=0x80))
148148 break;
149149 };
150150
@@ -179,10 +179,10 @@
179179 /**********************************************************************/
180180
181181 void write_maybe_escaped_char(char *cp,HASHED_STRING *br,FILE *f) {
182- int c,do_esc,i;
182+ int c,cl,do_esc,i;
183183 char out_buffer[11];
184184
185- switch (char_length(cp)) {
185+ switch ((cl=char_length(cp))) {
186186 case 1:
187187 c=(unsigned char)cp[0];
188188 break;
@@ -292,17 +292,18 @@
292292 if ((output_recipe[OS_ESCAPE_HOW]=='5') &&
293293 ((c<=0x1F) || (c==0x7F))) {
294294 sprintf(out_buffer,"\\x%02X",c);
295- } else {
296- if (((c|0x20)<'a') || ((c|0x20)>'z'))
297- out_buffer[0]='\\';
298- i=1;
299- while (1) {
300- out_buffer[i]=cp[i-1];
301- i++;
302- if ((cp[i]&0xC0)!=0x80)
303- break;
295+ } else if (((c|0x20)>='a') && ((c|0x20)<='z')) {
296+ out_buffer[0]=c;
297+ out_buffer[1]='\0';
298+ } else {
299+ out_buffer[0]='\\';
300+ for (i=0;i<cl;i++)
301+ out_buffer[i+1]=cp[i];
302+ out_buffer[i+1]='\0';
303+ if (c==0) {
304+ wrap_write(out_buffer,2,f);
305+ return;
304306 }
305- out_buffer[i]='\0';
306307 }
307308 break;
308309 }
Show on old repository browser