Lines Matching refs:p

66 	char_u *p = utf16_to_enc(newbuf, NULL);  in get_short_pathname()  local
68 if (p != NULL) in get_short_pathname()
71 *fnamep = *bufp = p; in get_short_pathname()
216 char_u *p; in shortpath_for_partial() local
223 for (p = *fnamep; p < *fnamep + *fnamelen; MB_PTR_ADV(p)) in shortpath_for_partial()
224 if (vim_ispathsep(*p)) in shortpath_for_partial()
250 for (p = tfname + len - 1; p >= tfname; --p) in shortpath_for_partial()
253 p -= mb_head_off(tfname, p); in shortpath_for_partial()
254 if (vim_ispathsep(*p)) in shortpath_for_partial()
264 --p; in shortpath_for_partial()
265 if (p >= tfname) in shortpath_for_partial()
266 *p = '~'; in shortpath_for_partial()
271 ++p; in shortpath_for_partial()
275 *fnamelen = (int)STRLEN(p); in shortpath_for_partial()
277 *fnamep = p; in shortpath_for_partial()
301 char_u *s, *p, *pbuf; in modify_fname() local
340 for (p = *fnamep; *p != NUL; MB_PTR_ADV(p)) in modify_fname()
342 if (vim_ispathsep(*p) in modify_fname()
343 && p[1] == '.' in modify_fname()
344 && (p[2] == NUL in modify_fname()
345 || vim_ispathsep(p[2]) in modify_fname()
346 || (p[2] == '.' in modify_fname()
347 && (p[3] == NUL || vim_ispathsep(p[3]))))) in modify_fname()
352 if (*p != NUL || !vim_isAbsName(*fnamep)) in modify_fname()
354 *fnamep = FullName_save(*fnamep, *p != NUL); in modify_fname()
375 char_u *p = utf16_to_enc(buf, NULL); in modify_fname() local
377 if (p != NULL) in modify_fname()
380 *bufp = *fnamep = p; in modify_fname()
420 p = pbuf = expand_env_save(*fnamep); in modify_fname()
422 p = pbuf = FullName_save(*fnamep, FALSE); in modify_fname()
425 p = *fnamep; in modify_fname()
429 if (p != NULL) in modify_fname()
449 if (fnamencmp(p, dirname, namelen) == 0) in modify_fname()
451 p += namelen; in modify_fname()
452 if (vim_ispathsep(*p)) in modify_fname()
454 while (*p && vim_ispathsep(*p)) in modify_fname()
455 ++p; in modify_fname()
456 *fnamep = p; in modify_fname()
469 home_replace(NULL, p, dirname, MAXPATHL, TRUE); in modify_fname()
507 p = vim_strsave((char_u *)"."); in modify_fname()
508 if (p == NULL) in modify_fname()
511 *bufp = *fnamep = tail = p; in modify_fname()
541 p = vim_strnsave(*fnamep, *fnamelen); in modify_fname()
542 if (p == NULL) in modify_fname()
545 *bufp = *fnamep = p; in modify_fname()
655 p = vim_strchr(s, sep); in modify_fname()
656 if (p != NULL) in modify_fname()
658 pat = vim_strnsave(s, p - s); in modify_fname()
661 s = p + 1; in modify_fname()
663 p = vim_strchr(s, sep); in modify_fname()
664 if (p != NULL) in modify_fname()
666 sub = vim_strnsave(s, p - s); in modify_fname()
670 *usedlen = (int)(p + 1 - src); in modify_fname()
699 p = vim_strsave_shellescape(*fnamep, FALSE, FALSE); in modify_fname()
702 if (p == NULL) in modify_fname()
705 *bufp = *fnamep = p; in modify_fname()
706 *fnamelen = (int)STRLEN(p); in modify_fname()
886 char_u *p = NULL; in f_exepath() local
890 (void)mch_can_exe(tv_get_string(&argvars[0]), &p, TRUE); in f_exepath()
892 rettv->vval.v_string = p; in f_exepath()
902 char_u *p; in f_filereadable() local
911 p = tv_get_string(&argvars[0]); in f_filereadable()
912 if (*p && !mch_isdir(p) && (fd = mch_open((char *)p, in f_filereadable()
946 char_u *p; in findfilendir() local
967 p = tv_get_string_buf_chk(&argvars[1], pathbuf); in findfilendir()
968 if (p == NULL) in findfilendir()
972 if (*p != NUL) in findfilendir()
973 path = p; in findfilendir()
1425 char_u *p; in mkdir_recurse() local
1431 p = gettail_sep(dir); in mkdir_recurse()
1432 if (p <= get_past_head(dir)) in mkdir_recurse()
1436 updir = vim_strnsave(dir, p - dir); in mkdir_recurse()
1504 char_u *p; in f_pathshorten() local
1520 p = tv_get_string_chk(&argvars[0]); in f_pathshorten()
1522 if (p == NULL) in f_pathshorten()
1526 p = vim_strsave(p); in f_pathshorten()
1527 rettv->vval.v_string = p; in f_pathshorten()
1528 if (p != NULL) in f_pathshorten()
1529 shorten_dir_len(p, trim_len); in f_pathshorten()
1634 char_u *p; in f_readdir() local
1661 p = ((char_u **)ga.ga_data)[i]; in f_readdir()
1662 list_append_string(rettv->vval.v_list, p, -1); in f_readdir()
1741 char_u *p; // position in buf in read_file_or_blob() local
1795 for (p = buf, start = buf; in read_file_or_blob()
1796 p < buf + readlen || (readlen <= 0 && (prevlen > 0 || binary)); in read_file_or_blob()
1797 ++p) in read_file_or_blob()
1799 if (*p == '\n' || readlen <= 0) in read_file_or_blob()
1803 long_u len = p - start; in read_file_or_blob()
1848 start = p + 1; // step over newline in read_file_or_blob()
1852 else if (*p == NUL) in read_file_or_blob()
1853 *p = '\n'; in read_file_or_blob()
1856 else if (*p == 0xbf && enc_utf8 && !binary) in read_file_or_blob()
1860 char_u back1 = p >= buf + 1 ? p[-1] in read_file_or_blob()
1862 char_u back2 = p >= buf + 2 ? p[-2] in read_file_or_blob()
1863 : p == buf + 1 && prevlen >= 1 ? prev[prevlen - 1] in read_file_or_blob()
1868 char_u *dest = p - 2; in read_file_or_blob()
1873 start = p + 1; in read_file_or_blob()
1885 if (readlen > p - buf + 1) in read_file_or_blob()
1886 mch_memmove(dest, p + 1, readlen - (p - buf) - 1); in read_file_or_blob()
1889 p = dest - 1; in read_file_or_blob()
1897 if (start < p) in read_file_or_blob()
1900 if (p - start + prevlen >= prevsize) in read_file_or_blob()
1910 prevsize = (long)(p - start); in read_file_or_blob()
1914 long growmin = (long)((p - start) * 2 + prevlen); in read_file_or_blob()
1927 mch_memmove(prev + prevlen, start, p - start); in read_file_or_blob()
1928 prevlen += (long)(p - start); in read_file_or_blob()
1986 char_u *p; in f_resolve() local
1994 p = tv_get_string(&argvars[0]); in f_resolve()
1999 v = mch_resolve_path(p, TRUE); in f_resolve()
2003 rettv->vval.v_string = vim_strsave(p); in f_resolve()
2016 p = vim_strsave(p); in f_resolve()
2017 if (p == NULL) in f_resolve()
2019 if (p[0] == '.' && (vim_ispathsep(p[1]) in f_resolve()
2020 || (p[1] == '.' && (vim_ispathsep(p[2]))))) in f_resolve()
2023 len = STRLEN(p); in f_resolve()
2024 if (len > 1 && after_pathsep(p, p + len)) in f_resolve()
2027 p[len - 1] = NUL; // the trailing slash breaks readlink() in f_resolve()
2030 q = getnextcomp(p); in f_resolve()
2042 vim_free(p); in f_resolve()
2050 len = readlink((char *)p, (char *)buf, MAXPATHL); in f_resolve()
2057 vim_free(p); in f_resolve()
2088 q = gettail(p); in f_resolve()
2089 if (q > p && *q == NUL) in f_resolve()
2093 q = gettail(p); in f_resolve()
2095 if (q > p && !mch_isFullName(buf)) in f_resolve()
2098 cpy = alloc(STRLEN(p) + STRLEN(buf) + 1); in f_resolve()
2101 STRCPY(cpy, p); in f_resolve()
2103 vim_free(p); in f_resolve()
2104 p = cpy; in f_resolve()
2109 vim_free(p); in f_resolve()
2110 p = vim_strsave(buf); in f_resolve()
2120 cpy = vim_strnsave(p, STRLEN(p) + len); in f_resolve()
2124 vim_free(p); in f_resolve()
2125 p = cpy; in f_resolve()
2136 if (!vim_ispathsep(*p)) in f_resolve()
2139 && *p != NUL in f_resolve()
2140 && !(p[0] == '.' in f_resolve()
2141 && (p[1] == NUL in f_resolve()
2142 || vim_ispathsep(p[1]) in f_resolve()
2143 || (p[1] == '.' in f_resolve()
2144 && (p[2] == NUL in f_resolve()
2145 || vim_ispathsep(p[2])))))) in f_resolve()
2148 cpy = concat_str((char_u *)"./", p); in f_resolve()
2151 vim_free(p); in f_resolve()
2152 p = cpy; in f_resolve()
2158 q = p; in f_resolve()
2161 if (q > p) in f_resolve()
2162 STRMOVE(p, p + 2); in f_resolve()
2170 q = p + STRLEN(p); in f_resolve()
2171 if (after_pathsep(p, q)) in f_resolve()
2172 *gettail_sep(p) = NUL; in f_resolve()
2175 rettv->vval.v_string = p; in f_resolve()
2178 rettv->vval.v_string = vim_strsave(p); in f_resolve()
2587 char_u *p; in home_replace() local
2655 p = homedir; in home_replace()
2660 && fnamencmp(src, p, len) == 0 in home_replace()
2674 if (p == homedir_env) in home_replace()
2676 p = homedir_env; in home_replace()
2834 char_u *p; in gettail_sep() local
2837 p = get_past_head(fname); // don't remove the '/' from "c:/file" in gettail_sep()
2839 while (t > p && after_pathsep(fname, t)) in gettail_sep()
2939 char_u *p; in dir_of_file_exists() local
2943 p = gettail_sep(fname); in dir_of_file_exists()
2944 if (p == fname) in dir_of_file_exists()
2946 c = *p; in dir_of_file_exists()
2947 *p = NUL; in dir_of_file_exists()
2949 *p = c; in dir_of_file_exists()
3026 add_pathsep(char_u *p) in add_pathsep() argument
3028 if (*p != NUL && !after_pathsep(p, p + STRLEN(p))) in add_pathsep()
3029 STRCAT(p, PATHSEPSTR); in add_pathsep()
3128 char_u *p; in expand_wildcards() local
3189 p = (*files)[i]; in expand_wildcards()
3192 (*files)[non_suf_match++] = p; in expand_wildcards()
3245 vim_backtick(char_u *p) in vim_backtick() argument
3247 return (*p == '`' && *(p + 1) != NUL && *(p + STRLEN(p) - 1) == '`'); in vim_backtick()
3261 char_u *p; in expand_backtick() local
3287 p = cmd; in expand_backtick()
3288 while (*p != NUL && *p != '\r' && *p != '\n') // skip over entry in expand_backtick()
3289 ++p; in expand_backtick()
3291 if (p > cmd) in expand_backtick()
3293 i = *p; in expand_backtick()
3294 *p = NUL; in expand_backtick()
3296 *p = i; in expand_backtick()
3299 cmd = p; in expand_backtick()
3343 char_u *p, *s, *e; in dos_expandpath() local
3377 p = buf; in dos_expandpath()
3386 *p++ = *path_end++; in dos_expandpath()
3391 s = p + 1; in dos_expandpath()
3395 e = p; in dos_expandpath()
3399 STRNCPY(p, path_end, len); in dos_expandpath()
3400 p += len; in dos_expandpath()
3404 *p++ = *path_end++; in dos_expandpath()
3406 e = p; in dos_expandpath()
3412 for (p = buf + wildoff; p < s; ++p) in dos_expandpath()
3413 if (rem_backslash(p)) in dos_expandpath()
3415 STRMOVE(p, p + 1); in dos_expandpath()
3421 for (p = s; p < e; ++p) in dos_expandpath()
3422 if (p[0] == '*' && p[1] == '*') in dos_expandpath()
3471 p = utf16_to_enc(wfb.cFileName, NULL); // p is allocated here in dos_expandpath()
3473 if (p == NULL) in dos_expandpath()
3479 if (*wfb.cAlternateFileName == NUL || p[STRLEN(p) - 1] == '~') in dos_expandpath()
3486 if ((p[0] != '.' || starts_with_dot in dos_expandpath()
3488 && p[1] != NUL && (p[1] != '.' || p[2] != NUL))) in dos_expandpath()
3491 && (vim_regexec(&regmatch, p, (colnr_T)0) in dos_expandpath()
3495 && fnamencmp(path + (s - buf), p, e - s) == 0))) in dos_expandpath()
3497 STRCPY(s, p); in dos_expandpath()
3531 vim_free(p); in dos_expandpath()
3588 char_u *p, *s, *e; in unix_expandpath() local
3619 p = buf; in unix_expandpath()
3628 *p++ = *path_end++; in unix_expandpath()
3633 s = p + 1; in unix_expandpath()
3639 e = p; in unix_expandpath()
3643 STRNCPY(p, path_end, len); in unix_expandpath()
3644 p += len; in unix_expandpath()
3648 *p++ = *path_end++; in unix_expandpath()
3650 e = p; in unix_expandpath()
3656 for (p = buf + wildoff; p < s; ++p) in unix_expandpath()
3657 if (rem_backslash(p)) in unix_expandpath()
3659 STRMOVE(p, p + 1); in unix_expandpath()
3665 for (p = s; p < e; ++p) in unix_expandpath()
3666 if (p[0] == '*' && p[1] == '*') in unix_expandpath()
3797 has_env_var(char_u *p) in has_env_var() argument
3799 for ( ; *p; MB_PTR_ADV(p)) in has_env_var()
3801 if (*p == '\\' && p[1] != NUL) in has_env_var()
3802 ++p; in has_env_var()
3809 , *p) != NULL) in has_env_var()
3821 has_special_wildchar(char_u *p) in has_special_wildchar() argument
3823 for ( ; *p; MB_PTR_ADV(p)) in has_special_wildchar()
3826 if (*p == '\r' || *p == '\n') in has_special_wildchar()
3829 if (*p == '\\' && p[1] != NUL && p[1] != '\r' && p[1] != '\n') in has_special_wildchar()
3830 ++p; in has_special_wildchar()
3831 else if (vim_strchr((char_u *)SPECIAL_WILDCHAR, *p) != NULL) in has_special_wildchar()
3834 if (*p == '{' && vim_strchr(p, '}') == NULL) in has_special_wildchar()
3837 if ((*p == '`' || *p == '\'') && vim_strchr(p, *p) == NULL) in has_special_wildchar()
3867 char_u *p; in gen_expand_wildcards() local
3916 p = pat[i]; in gen_expand_wildcards()
3919 if (vim_backtick(p)) in gen_expand_wildcards()
3921 add_pat = expand_backtick(&ga, p, flags); in gen_expand_wildcards()
3931 if ((has_env_var(p) && !(flags & EW_NOTENV)) || *p == '~') in gen_expand_wildcards()
3933 p = expand_env_save_opt(p, TRUE); in gen_expand_wildcards()
3934 if (p == NULL) in gen_expand_wildcards()
3935 p = pat[i]; in gen_expand_wildcards()
3942 else if (has_env_var(p) || *p == '~') in gen_expand_wildcards()
3944 vim_free(p); in gen_expand_wildcards()
3961 if (mch_has_exp_wildcard(p)) in gen_expand_wildcards()
3965 && !mch_isFullName(p) in gen_expand_wildcards()
3966 && !(p[0] == '.' in gen_expand_wildcards()
3967 && (vim_ispathsep(p[1]) in gen_expand_wildcards()
3968 || (p[1] == '.' && vim_ispathsep(p[2])))) in gen_expand_wildcards()
3974 add_pat = expand_in_path(&ga, p, flags); in gen_expand_wildcards()
3980 add_pat = mch_expandpath(&ga, p, flags); in gen_expand_wildcards()
3986 char_u *t = backslash_halve_save(p); in gen_expand_wildcards()
3995 if (t != p) in gen_expand_wildcards()
4001 uniquefy_paths(&ga, p); in gen_expand_wildcards()
4003 if (p != pat[i]) in gen_expand_wildcards()
4004 vim_free(p); in gen_expand_wildcards()
4035 char_u *p; in addfile() local
4064 p = alloc(STRLEN(f) + 1 + isdir); in addfile()
4065 if (p == NULL) in addfile()
4068 STRCPY(p, f); in addfile()
4070 slash_adjust(p); in addfile()
4077 add_pathsep(p); in addfile()
4079 ((char_u **)gap->ga_data)[gap->ga_len++] = p; in addfile()
4102 pathcmp(const char *p, const char *q, int maxlen) in pathcmp() argument
4110 c1 = PTR2CHAR((char_u *)p + i); in pathcmp()
4126 s = p; in pathcmp()
4146 i += mb_ptr2len((char_u *)p + i); in pathcmp()