-/* We don't want dot or dot-dot anywhere. */
-static int verify_dotfile(const char *rest)
-{
- /*
- * The first character was '.', but that has already been discarded, we
- * now test the rest.
- */
- switch (*rest) {
- case '\0': case '/': /* /foo/. and /foo/./bar are not ok */
- return -1;
- case '.': /* path start with /foo/.. */
- if (rest[1] == '\0' || rest[1] == '/')
- return -1; /* /foo/.. or /foo/../bar are not ok */
- /* /foo/..bar is ok */
- }
- return 1;
-}
-