| 36 | /* Must F designate the working directory? */ |
| 37 | |
| 38 | ATTRIBUTE_PURE static bool |
| 39 | must_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. |
no outgoing calls
no test coverage detected