pike.git / src / modules / _Stdio / efuns.c

version» Context lines:

pike.git/src/modules/_Stdio/efuns.c:990: Inside #if defined(__NT__)
  void f_get_dir(INT32 args)   {    HANDLE dir;    WIN32_FIND_DATAW d;    struct pike_string *str=0;    p_wchar1 *pattern;    size_t plen;       get_all_args("get_dir", args, ".%S", &str);    -  if(!str) { +  /* NB: The empty string is also an alias for the current directory. +  * This is a convenience eg when recursing with dirname(). +  */ +  if(!str || !str->len) {    push_static_text(".");    str = Pike_sp[-1].u.string;    args++;    } else if (string_has_null(str)) {    /* Filenames with NUL are not supported. */    errno = ENOENT;    pop_n_elems(args);    push_int(0);    return;    }
pike.git/src/modules/_Stdio/efuns.c:1209: Inside #if defined(USE_FDOPENDIR)
  {   #ifdef USE_FDOPENDIR    int dir_fd;   #endif    DIR *dir = NULL;    ptrdiff_t name_max = -1;    struct pike_string *str=0;       get_all_args("get_dir",args,".%N",&str);    -  if(!str) { +  /* NB: The empty string is also an alias for the current directory. +  * This is a convenience eg when recursing with dirname(). +  */ +  if(!str || !str->len) {   #if defined(__amigaos4__)    push_empty_string();   #else    push_static_text(".");   #endif    str = Pike_sp[-1].u.string;    args++;    }       if (string_has_null(str)) {