Lines Matching refs:resolved

48 char *sftp_realpath(const char *path, char *resolved);
58 sftp_realpath(const char *path, char *resolved) in sftp_realpath() argument
74 if (resolved == NULL) { in sftp_realpath()
75 resolved = malloc(PATH_MAX); in sftp_realpath()
76 if (resolved == NULL) in sftp_realpath()
84 resolved[0] = '/'; in sftp_realpath()
85 resolved[1] = '\0'; in sftp_realpath()
87 return (resolved); in sftp_realpath()
91 if (getcwd(resolved, PATH_MAX) == NULL) { in sftp_realpath()
93 free(resolved); in sftp_realpath()
95 strlcpy(resolved, ".", PATH_MAX); in sftp_realpath()
98 resolved_len = strlen(resolved); in sftp_realpath()
125 if (resolved[resolved_len - 1] != '/') { in sftp_realpath()
130 resolved[resolved_len++] = '/'; in sftp_realpath()
131 resolved[resolved_len] = '\0'; in sftp_realpath()
143 resolved[resolved_len - 1] = '\0'; in sftp_realpath()
144 q = strrchr(resolved, '/') + 1; in sftp_realpath()
146 resolved_len = q - resolved; in sftp_realpath()
156 resolved_len = strlcat(resolved, next_token, PATH_MAX); in sftp_realpath()
161 if (lstat(resolved, &sb) != 0) { in sftp_realpath()
164 return (resolved); in sftp_realpath()
173 slen = readlink(resolved, symlink, sizeof(symlink) - 1); in sftp_realpath()
178 resolved[1] = 0; in sftp_realpath()
182 resolved[resolved_len - 1] = '\0'; in sftp_realpath()
183 q = strrchr(resolved, '/') + 1; in sftp_realpath()
185 resolved_len = q - resolved; in sftp_realpath()
217 if (resolved_len > 1 && resolved[resolved_len - 1] == '/') in sftp_realpath()
218 resolved[resolved_len - 1] = '\0'; in sftp_realpath()
219 return (resolved); in sftp_realpath()
223 free(resolved); in sftp_realpath()