src/gtkspell.c

changeset 2456
e6fc7d36689b
parent 2454
e6619c1d0e29
child 2457
1b507a97b824
equal deleted inserted replaced
2455:014bd5a2d3fe 2456:e6fc7d36689b
353 for (end = pos; end <= gtk_text_get_length(gtktext); end++) { 353 for (end = pos; end <= gtk_text_get_length(gtktext); end++) {
354 if (iswordsep(GTK_TEXT_INDEX(gtktext, end))) break; 354 if (iswordsep(GTK_TEXT_INDEX(gtktext, end))) break;
355 } 355 }
356 356
357 if (buf) { 357 if (buf) {
358 *buf = g_malloc(end - start + 1); 358 char *tmp = g_malloc(end - start + 1);
359 for (pos = start; pos < end; pos++) 359 for (pos = start; pos < end; pos++)
360 (*buf)[pos-start] = GTK_TEXT_INDEX(gtktext, pos); 360 tmp[pos-start] = GTK_TEXT_INDEX(gtktext, pos);
361 (*buf)[pos-start] = 0; 361 tmp[pos-start] = 0;
362 *buf = tmp;
362 } 363 }
363 364
364 if (pstart) *pstart = start; 365 if (pstart) *pstart = start;
365 if (pend) *pend = end; 366 if (pend) *pend = end;
366 367

mercurial