Lines Matching refs:p
76 file_name_free (struct file_name *p) in file_name_free() argument
78 free (p->buf); in file_name_free()
79 free (p); in file_name_free()
85 struct file_name *p = xmalloc (sizeof *p); in file_name_init() local
89 p->n_alloc = MIN (2 * PATH_MAX, 32 * 1024); in file_name_init()
91 p->buf = xmalloc (p->n_alloc); in file_name_init()
92 p->start = p->buf + (p->n_alloc - 1); in file_name_init()
93 p->start[0] = '\0'; in file_name_init()
94 return p; in file_name_init()
99 file_name_prepend (struct file_name *p, char const *s, size_t s_len) in file_name_prepend() argument
101 size_t n_free = p->start - p->buf; in file_name_prepend()
104 size_t half = p->n_alloc + 1 + s_len; in file_name_prepend()
110 size_t n_used = p->n_alloc - n_free; in file_name_prepend()
111 p->start = q + 2 * half - n_used; in file_name_prepend()
112 memcpy (p->start, p->buf + n_free, n_used); in file_name_prepend()
113 free (p->buf); in file_name_prepend()
114 p->buf = q; in file_name_prepend()
115 p->n_alloc = 2 * half; in file_name_prepend()
118 p->start -= 1 + s_len; in file_name_prepend()
119 p->start[0] = '/'; in file_name_prepend()
120 memcpy (p->start + 1, s, s_len); in file_name_prepend()
128 char *p = buf; in nth_parent() local
132 memcpy (p, "../", 3); in nth_parent()
133 p += 3; in nth_parent()
135 p[-1] = '\0'; in nth_parent()
303 char *p; in logical_getcwd() local
308 p = wd; in logical_getcwd()
309 while ((p = strstr (p, "/."))) in logical_getcwd()
311 if (!p[2] || p[2] == '/' in logical_getcwd()
312 || (p[2] == '.' && (!p[3] || p[3] == '/'))) in logical_getcwd()
314 p++; in logical_getcwd()