Lines Matching refs:path
44 char *path; member
54 if (pglob && pglob->path) { in _php_glob_stream_get_path()
59 return estrndup(pglob->path, pglob->path_len); in _php_glob_stream_get_path()
61 return pglob->path; in _php_glob_stream_get_path()
112 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
114 const char *pos, *gpath = path; in php_glob_stream_path_split()
116 if ((pos = strrchr(path, '/')) != NULL) { in php_glob_stream_path_split()
117 path = pos+1; in php_glob_stream_path_split()
120 if ((pos = strrchr(path, '\\')) != NULL) { in php_glob_stream_path_split()
121 path = pos+1; in php_glob_stream_path_split()
125 *p_file = path; in php_glob_stream_path_split()
128 if (pglob->path) { in php_glob_stream_path_split()
129 efree(pglob->path); in php_glob_stream_path_split()
131 if (path != gpath) { in php_glob_stream_path_split()
132 path--; in php_glob_stream_path_split()
134 pglob->path_len = path - gpath; in php_glob_stream_path_split()
135 pglob->path = estrndup(gpath, pglob->path_len); in php_glob_stream_path_split()
144 const char *path; in php_glob_stream_read() local
149 …_stream_path_split(pglob, pglob->glob.gl_pathv[pglob->index++], pglob->flags & GLOB_APPEND, &path); in php_glob_stream_read()
150 PHP_STRLCPY(ent->d_name, path, sizeof(ent->d_name), strlen(path)); in php_glob_stream_read()
154 if (pglob->path) { in php_glob_stream_read()
155 efree(pglob->path); in php_glob_stream_read()
156 pglob->path = NULL; in php_glob_stream_read()
171 if (pglob->path) { in php_glob_stream_close()
172 efree(pglob->path); in php_glob_stream_close()
189 if (pglob->path) { in php_glob_stream_rewind()
190 efree(pglob->path); in php_glob_stream_rewind()
191 pglob->path = NULL; in php_glob_stream_rewind()
209 static php_stream *php_glob_stream_opener(php_stream_wrapper *wrapper, const char *path, const char… in php_glob_stream_opener() argument
216 if (!strncmp(path, "glob://", sizeof("glob://")-1)) { in php_glob_stream_opener()
217 path += sizeof("glob://")-1; in php_glob_stream_opener()
219 *opened_path = zend_string_init(path, strlen(path), 0); in php_glob_stream_opener()
223 if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path)) { in php_glob_stream_opener()
229 if (0 != (ret = glob(path, pglob->flags & GLOB_FLAGMASK, NULL, &pglob->glob))) { in php_glob_stream_opener()
239 pos = path; in php_glob_stream_opener()
257 php_glob_stream_path_split(pglob, path, 1, &tmp); in php_glob_stream_opener()