Lines Matching refs:path
42 char *path; member
52 if (pglob && pglob->path) { in _php_glob_stream_get_path()
57 return estrndup(pglob->path, pglob->path_len); in _php_glob_stream_get_path()
59 return pglob->path; in _php_glob_stream_get_path()
110 static void php_glob_stream_path_split(glob_s_t *pglob, const char *path, int get_path, const char … in php_glob_stream_path_split() argument
112 const char *pos, *gpath = path; in php_glob_stream_path_split()
114 if ((pos = strrchr(path, '/')) != NULL) { in php_glob_stream_path_split()
115 path = pos+1; in php_glob_stream_path_split()
118 if ((pos = strrchr(path, '\\')) != NULL) { in php_glob_stream_path_split()
119 path = pos+1; in php_glob_stream_path_split()
123 *p_file = path; in php_glob_stream_path_split()
126 if (pglob->path) { in php_glob_stream_path_split()
127 efree(pglob->path); in php_glob_stream_path_split()
129 if ((path - gpath) > 1) { in php_glob_stream_path_split()
130 path--; in php_glob_stream_path_split()
132 pglob->path_len = path - gpath; in php_glob_stream_path_split()
133 pglob->path = estrndup(gpath, pglob->path_len); in php_glob_stream_path_split()
142 const char *path; in php_glob_stream_read() local
147 …_stream_path_split(pglob, pglob->glob.gl_pathv[pglob->index++], pglob->flags & GLOB_APPEND, &path); in php_glob_stream_read()
148 PHP_STRLCPY(ent->d_name, path, sizeof(ent->d_name), strlen(path)); in php_glob_stream_read()
152 if (pglob->path) { in php_glob_stream_read()
153 efree(pglob->path); in php_glob_stream_read()
154 pglob->path = NULL; in php_glob_stream_read()
169 if (pglob->path) { in php_glob_stream_close()
170 efree(pglob->path); in php_glob_stream_close()
187 if (pglob->path) { in php_glob_stream_rewind()
188 efree(pglob->path); in php_glob_stream_rewind()
189 pglob->path = NULL; in php_glob_stream_rewind()
207 static php_stream *php_glob_stream_opener(php_stream_wrapper *wrapper, const char *path, const char… in php_glob_stream_opener() argument
214 if (!strncmp(path, "glob://", sizeof("glob://")-1)) { in php_glob_stream_opener()
215 path += sizeof("glob://")-1; in php_glob_stream_opener()
217 *opened_path = zend_string_init(path, strlen(path), 0); in php_glob_stream_opener()
221 if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path)) { in php_glob_stream_opener()
227 if (0 != (ret = glob(path, pglob->flags & GLOB_FLAGMASK, NULL, &pglob->glob))) { in php_glob_stream_opener()
237 pos = path; in php_glob_stream_opener()
255 php_glob_stream_path_split(pglob, path, 1, &tmp); in php_glob_stream_opener()