re_delete(): * delete num characters d at dat, maximum length of d is dlen */
| 405 | * delete num characters d at dat, maximum length of d is dlen |
| 406 | */ |
| 407 | private void |
| 408 | /*ARGSUSED*/ |
| 409 | re_delete(EditLine *el __attribute__((__unused__)), |
| 410 | Char *d, int dat, int dlen, int num) |
| 411 | { |
| 412 | Char *a, *b; |
| 413 | |
| 414 | if (num <= 0) |
| 415 | return; |
| 416 | if (dat + num >= dlen) { |
| 417 | d[dat] = '\0'; |
| 418 | return; |
| 419 | } |
| 420 | ELRE_DEBUG(1, |
| 421 | (__F, "re_delete() starting: %d at %d max %d, d == \"%s\"\n", |
| 422 | num, dat, dlen, ct_encode_string(d))); |
| 423 | |
| 424 | /* open up the space for num chars */ |
| 425 | if (num > 0) { |
| 426 | b = d + dat; |
| 427 | a = b + num; |
| 428 | while (a < &d[dlen]) |
| 429 | *b++ = *a++; |
| 430 | d[dlen] = '\0'; /* just in case */ |
| 431 | } |
| 432 | ELRE_DEBUG(1, |
| 433 | (__F, "re_delete() after delete: %d at %d max %d, d == \"%s\"\n", |
| 434 | num, dat, dlen, ct_encode_string(d))); |
| 435 | } |
| 436 | |
| 437 | |
| 438 | /* re__strncopy(): |
no test coverage detected