Lines Matching refs:npath

41 	char *npath, *npath_pos;
50 /* relative; initialize npath with current directory */
51 if (t_getcwd_noalloc(&npath, &asize, error_r) < 0)
53 npath_pos = npath + strlen(npath);
54 i_assert(npath[0] == '/');
56 /* absolute; initialize npath with root */
58 npath = t_buffer_get(asize);
59 npath[0] = '/';
60 npath_pos = npath + 1;
84 i_assert(npath_pos >= npath);
85 if ((npath_pos - npath) > 1) {
92 i_assert(npath_pos >= npath);
93 if ((size_t)((npath_pos - npath) + seglen + 1) >= asize) {
94 ptrdiff_t npath_offset = npath_pos - npath;
96 npath = t_buffer_reget(npath, asize);
97 npath_pos = npath + npath_offset;
100 /* make sure npath now ends in slash */
101 i_assert(npath_pos > npath);
103 i_assert((size_t)((npath_pos - npath) + 1) < asize);
108 i_assert(npath_pos >= npath);
109 i_assert((size_t)((npath_pos - npath) + seglen) < asize);
117 if (lstat(npath, &st) < 0) {
140 [npath][0][preserved tail][link buffer][room for tail][0]
143 i_assert(npath_pos >= npath);
144 if ((size_t)((npath_pos - npath) + espace + lsize) >= asize) {
145 ptrdiff_t npath_offset = npath_pos - npath;
148 npath = t_buffer_reget(npath, asize);
149 npath_pos = npath + npath_offset;
153 /* preserve tail just after end of npath */
154 i_assert(npath_pos >= npath);
155 i_assert((size_t)((npath_pos + 1 - npath) + ltlen) < asize);
164 i_assert((size_t)((npath_link - npath) + lsize) < asize);
167 if ((ret=readlink(npath, npath_link, lsize)) < 0) {
190 i_assert(npath_pos >= npath);
191 if ((size_t)((npath_pos - npath) + espace + lsize) >= asize ||
193 ptrdiff_t npath_offset = npath_pos - npath;
196 npath = t_buffer_reget(npath, asize);
197 npath_pos = npath + npath_offset;
202 i_assert(npath_link >= npath);
204 i_assert(npath_pos >= npath);
205 i_assert((size_t)((npath_pos - npath) + 1 + tlen) < asize);
206 i_assert((size_t)((npath_link - npath) + ret + tlen) < asize);
209 i_assert((size_t)((npath_link - npath) + ret + tlen) < asize);
219 npath_pos = npath + 1;
222 i_assert(npath_pos >= npath);
223 if ((npath_pos - npath) > 1) {
233 *error_r = t_strdup_printf("Not a directory: %s", npath);
241 i_assert(npath_pos >= npath);
242 i_assert((size_t)(npath_pos - npath) < asize);
245 if ((npath_pos - npath) > 1 && *(npath_pos-1) == '/')
249 t_buffer_alloc(npath_pos - npath + 1);
250 *npath_r = npath;