Lines Matching refs:path

170 	char*			path;
214 if (path = findcodes[i])
216 if (*path == '/')
218 if (!stat(path, &st))
224 sfsprintf(fp->encode.file, sizeof(fp->encode.file), "%s/%s", path, findnames[k]);
227 path = fp->encode.file;
236 path = fp->encode.file;
246 sfsprintf(fp->encode.file, sizeof(fp->encode.file), "%s", path);
247 path = fp->encode.file;
251 else if (i < 2 || strmatch(path, FIND_MATCH))
253 sfsprintf(fp->encode.file, sizeof(fp->encode.file), "%s", path);
260 path = fp->encode.file;
266 else if (pathpath(fp->encode.file, path, "", PATH_REGULAR|PATH_READ|PATH_WRITE))
268 path = fp->encode.file;
271 else if (b = strrchr(path, '/'))
273 sfsprintf(fp->encode.file, sizeof(fp->encode.file), "%-.*s", b - path, path);
278 path = fp->encode.file;
311 if (s = strrchr(path, '/'))
314 p = path;
392 if (path = findcodes[i])
394 if (*path == '/')
396 if (!stat(path, &st))
402 sfsprintf(fp->decode.path, sizeof(fp->decode.path), "%s/%s", path, findnames[k]);
403 if (fp->fp = sfopen(NiL, fp->decode.path, "r"))
405 path = fp->decode.path;
412 else if (fp->fp = sfopen(NiL, path, "r"))
416 else if ((path = pathpath(fp->decode.path, path, "", PATH_REGULAR|PATH_READ)) && (fp->fp = sfopen(NiL, path, "r")))
428 (*fp->disc->errorf)(fp, fp->disc, 2, "%s: cannot stat codes", path);
482 if (j == EOF || fp->decode.count >= sizeof(fp->decode.path))
484 fp->decode.path[fp->decode.count++] = j;
542 else if (!p && !(p = getcwd(fp->decode.path, sizeof(fp->decode.path))))
578 (*fp->disc->errorf)(fp, fp->disc, 2, "%s: %s code format does not support directory verification", path, fp->method == FF_gnu ? FF_gnu_magic : "OLD-BIGRAM");
684 (*fp->disc->errorf)(fp, fp->disc, 2, "%s: invalid codes", path);
695 * return the next fastfind path
755 p = fp->decode.path + (fp->decode.count += n);
783 * first encoded path motion
807 for (p = fp->decode.path + fp->decode.count; (c = sfgetc(fp->fp)) > FF_ESC;)
819 b = fp->decode.path;
837 if ((n = p - fp->decode.path + 1) > (m = *fp->lens))
841 if (!strncasecmp(*fp->dirs, fp->decode.path, m))
848 if (!(n = strcasecmp(*fp->dirs, fp->decode.path)) && (ignorecase || !strcmp(*fp->dirs, fp->decode.path)))
869 if ((n = p - fp->decode.path))
874 n = (*fp->verifyf)(fp, fp->decode.path, n, fp->disc);
875 else if (stat(fp->decode.path, &st))
897 if (*fp->decode.pattern == '/' && b > fp->decode.path)
909 if (!fp->decode.match || strgrpmatch(fp->decode.path, fp->decode.pattern, NiL, 0, STR_MAXIMAL|STR_LEFT|STR_RIGHT|ignorecase))
914 if (!fp->secure || !access(fp->decode.path, F_OK))
915 return fp->decode.path;
921 else if (!fp->decode.match || !(n = regexec(&fp->decode.re, fp->decode.path, 0, NiL, 0)))
924 if (*p == '/' && p > fp->decode.path)
926 if (!fp->secure || !access(fp->decode.path, F_OK))
927 return fp->decode.path;
943 * add path to the code table
948 findwrite(register Find_t* fp, const char* path, size_t len, const char* type)
962 len = sfsprintf(fp->encode.mark, sizeof(fp->encode.mark), "%-.*s/", len, path);
963 path = fp->encode.mark;
965 s = (unsigned char*)path;
967 len = strlen(path);
968 if (len < sizeof(fp->encode.path))
972 len = sizeof(fp->encode.path) - 1;
975 p = (unsigned char*)fp->encode.path;
982 n = s - (unsigned char*)path;
1045 memcpy(fp->encode.path, path, len);