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

Function process_path

src/realpath.c:167–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167static bool
168process_path (char const *fname, int can_mode)
169{
170 char *can_fname = realpath_canon (fname, can_mode);
171 if (!can_fname)
172 {
173 if (verbose)
174 error (0, errno, "%s", quotef (fname));
175 return false;
176 }
177
178 if (!can_relative_to
179 || (can_relative_base && !path_prefix (can_relative_base, can_fname))
180 || (can_relative_to && !relpath (can_fname, can_relative_to, NULL, 0)))
181 fputs (can_fname, stdout);
182
183 putchar (use_nuls ? '\0' : '\n');
184
185 free (can_fname);
186
187 if (ferror (stdout))
188 write_error ();
189
190 return true;
191}
192
193int
194main (int argc, char **argv)

Callers 1

mainFunction · 0.85

Calls 4

realpath_canonFunction · 0.85
path_prefixFunction · 0.85
relpathFunction · 0.85
write_errorFunction · 0.85

Tested by

no test coverage detected