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

Function splitbuf_finishup

src/env.c:329–338  ·  view source on GitHub ↗

All additions to SS have been made. Convert its offsets to pointers, and return the resulting argument vector. */

Source from the content-addressed store, hash-verified

327/* All additions to SS have been made. Convert its offsets to pointers,
328 and return the resulting argument vector. */
329static char **
330splitbuf_finishup (struct splitbuf *ss)
331{
332 int argc = ss->argc;
333 char **argv = ss->argv;
334 char *stringbase = (char *) (ss->argv + ss->half_alloc);
335 for (int i = 1; i < argc; i++)
336 argv[i] = stringbase + (intptr_t) argv[i];
337 return argv;
338}
339
340/* Return a newly-allocated argv-like array,
341 by parsing and splitting the input 'str'.

Callers 1

build_argvFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected