careadlinkat close-stream copy-file-range
count-leading-zeros count-one-bits count-trailing-zeros
crypto/md5-buffer crypto/sha1-buffer crypto/sha256-buffer crypto/sha512-buffer
- d-type diffseq dosname dtoastr dtotimespec dup2
+ d-type diffseq dosname double-slash-root dtoastr dtotimespec dup2
environ execinfo explicit_bzero faccessat
fcntl fcntl-h fdopendir
filemode filevercmp flexmember fpieee fstatat fsusage fsync
# Code from module dirent:
# Code from module dirfd:
# Code from module dosname:
+ # Code from module double-slash-root:
# Code from module dtoastr:
# Code from module dtotimespec:
# Code from module dup2:
gl_SHA512
gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE
gl_DIRENT_H
+ gl_DOUBLE_SLASH_ROOT
gl_FUNC_DUP2
if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
AC_LIBOBJ([dup2])
static char *
search_embedded_absfilename (char *nm, char *endp)
{
- char *p, *s;
-
- for (p = nm + 1; p < endp; p++)
+ char *p = nm + 1;
+#ifdef DOUBLE_SLASH_IS_DISTINCT_ROOT
+ p += (IS_DIRECTORY_SEP (p[-1]) && IS_DIRECTORY_SEP (p[0])
+ && !IS_DIRECTORY_SEP (p[1]));
+#endif
+ for (; p < endp; p++)
{
- if (IS_DIRECTORY_SEP (p[-1])
- && file_name_absolute_p (p)
-#if defined (WINDOWSNT) || defined (CYGWIN)
- /* // at start of file name is meaningful in Apollo,
- WindowsNT and Cygwin systems. */
- && !(IS_DIRECTORY_SEP (p[0]) && p - 1 == nm)
-#endif /* not (WINDOWSNT || CYGWIN) */
- )
+ if (IS_DIRECTORY_SEP (p[-1]) && file_name_absolute_p (p))
{
- for (s = p; *s && !IS_DIRECTORY_SEP (*s); s++);
+ char *s;
+ for (s = p; *s && !IS_DIRECTORY_SEP (*s); s++)
+ continue;
if (p[0] == '~' && s > p + 1) /* We've got "/~something/". */
{
USE_SAFE_ALLOCA;