MCPcopy Index your code
hub / github.com/coreutils/coreutils / xfields

Function xfields

src/join.c:316–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314/* Fill in the 'fields' structure in LINE. */
315
316static void
317xfields (struct line *line)
318{
319 char *ptr = line->buf.buffer;
320 char const *lim = ptr + line->buf.length - 1;
321
322 if (ptr == lim)
323 return;
324
325 if (!tab.len)
326 while ((ptr = skip_buf_matching (ptr, lim, newline_or_blank, true)) < lim)
327 {
328 char *sep = skip_buf_matching (ptr, lim, newline_or_blank, false);
329 extract_field (line, ptr, sep - ptr);
330 ptr = sep;
331 }
332 else
333 {
334 if (tab.ch != '\n')
335 for (char *sep;
336 (sep = skip_buf_matching (ptr, lim, eq_tab, false)) < lim;
337 ptr = sep + mcel_scan (sep, lim).len)
338 extract_field (line, ptr, sep - ptr);
339
340 extract_field (line, ptr, lim - ptr);
341 }
342}
343
344static void
345freeline (struct line *line)

Callers 1

get_lineFunction · 0.85

Calls 2

skip_buf_matchingFunction · 0.85
extract_fieldFunction · 0.85

Tested by

no test coverage detected