MCPcopy Create free account
hub / github.com/coreutils/coreutils / splitbuf_grow

Function splitbuf_grow

src/env.c:289–297  ·  view source on GitHub ↗

Expand SS so that it has at least one more argv slot and at least one more string byte. */

Source from the content-addressed store, hash-verified

287/* Expand SS so that it has at least one more argv slot and at least
288 one more string byte. */
289static void
290splitbuf_grow (struct splitbuf *ss)
291{
292 idx_t old_half_alloc = ss->half_alloc;
293 idx_t string_bytes = (intptr_t) ss->argv[ss->argc];
294 ss->argv = xpalloc (ss->argv, &ss->half_alloc, 1,
295 MIN (INT_MAX, IDX_MAX), 2 * sizeof *ss->argv);
296 memmove (ss->argv + ss->half_alloc, ss->argv + old_half_alloc, string_bytes);
297}
298
299/* In SS, append C to the last string. */
300static void

Callers 2

splitbuf_append_byteFunction · 0.85
check_start_new_argFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected