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

Function attach

src/ls.c:5222–5239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5220 non-malloc'ing version of file_name_concat. */
5221
5222static void
5223attach (char *dest, char const *dirname, char const *name)
5224{
5225 char const *dirnamep = dirname;
5226
5227 /* Copy dirname if it is not ".". */
5228 if (dirname[0] != '.' || dirname[1] != 0)
5229 {
5230 while (*dirnamep)
5231 *dest++ = *dirnamep++;
5232 /* Add '/' if 'dirname' doesn't already end with it. */
5233 if (dirnamep > dirname && dirnamep[-1] != '/')
5234 *dest++ = '/';
5235 }
5236 while (*name)
5237 *dest++ = *name++;
5238 *dest = 0;
5239}
5240
5241/* Allocate enough column info suitable for the current number of
5242 files and display columns, and initialize the info to represent the

Callers 1

gobble_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected