Branch: Tag:

2018-10-23

2018-10-23 09:10:59 by Henrik Grubbström (Grubba) <grubba@grubba.org>

EFUNs: get_dir("") is now an alias for get_dir(".").

This is a convenience when recursing with eg dirname().

Also removes a stray debug output.

3329: Inside #if defined(HAVE_FDOPENDIR) && defined(HAVE_OPENAT)
   get_all_args(NULL, args, ".%S", &path);       if (path && string_has_null(path)) { -  fprintf(stderr, "NULL\n"); +     /* Filenames with NUL are not supported. */    ERRNO = errno = ENOENT;    pop_n_elems(args);
3342: Inside #if defined(HAVE_FDOPENDIR) && defined(HAVE_OPENAT)
      while(1) {    THREADS_ALLOW_UID(); -  if (!path) { +  /* NB: The empty string is also an alias for the current directory. +  * This is a convenience eg when recursing with dirname(). +  */ +  if (!path || !path->len) {    dfd = dup(fd);    } else {    dfd = openat(fd, path->str, O_RDONLY);