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

Function must_be_working_directory

gl/lib/targetdir.c:38–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36/* Must F designate the working directory? */
37
38ATTRIBUTE_PURE static bool
39must_be_working_directory (char const *f)
40{
41 /* Return true for ".", "./.", ".///./", etc. */
42 while (*f++ == '.')
43 {
44 if (*f != '/')
45 return !*f;
46 while (*++f == '/')
47 continue;
48 if (!*f)
49 return true;
50 }
51 return false;
52}
53
54/* Return a file descriptor open to FILE, for use in openat.
55 As an optimization, return AT_FDCWD if FILE must be the working directory.

Callers 1

target_directory_operandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected