MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / re_delete

Function re_delete

extern/editline/src/refresh.c:407–435  ·  view source on GitHub ↗

re_delete(): * delete num characters d at dat, maximum length of d is dlen */

Source from the content-addressed store, hash-verified

405 * delete num characters d at dat, maximum length of d is dlen
406 */
407private void
408/*ARGSUSED*/
409re_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():

Callers 1

re_update_lineFunction · 0.85

Calls 1

ct_encode_stringFunction · 0.85

Tested by

no test coverage detected