commit 41ad2652808e8c045a2a82b97bb309e35fde2887 from: Stefan Sperling date: Fri Dec 04 20:27:43 2020 UTC remove unused function got_path_get_absolute(); realpath(3) is usually better commit - dbb02f4d25e3588f5eaecee3dd69a1306004af14 commit + 41ad2652808e8c045a2a82b97bb309e35fde2887 blob - 0219d3d35f26f8c729484c3c1e4243c3d1f8b97a blob + f2d6ba2e472496846c8519d36002ed09491009ed --- include/got_path.h +++ include/got_path.h @@ -27,12 +27,6 @@ struct dirent; int got_path_is_absolute(const char *); /* - * Return an absolute version of a relative path. - * The result is allocated with malloc(3). - */ -char *got_path_get_absolute(const char *); - -/* * Canonicalize absolute paths by removing redundant path separators * and resolving references to parent directories ("/../"). * Relative paths are copied from input to buf as-is. blob - 54f8f6f973385072b6bba9a07e98cca11948d8b8 blob + d94d085c6a81b1232aacfe54421d5ffa740b8393 --- lib/path.c +++ lib/path.c @@ -43,21 +43,6 @@ got_path_is_absolute(const char *path) return path[0] == '/'; } -char * -got_path_get_absolute(const char *relpath) -{ - char cwd[PATH_MAX]; - char *abspath; - - if (getcwd(cwd, sizeof(cwd)) == NULL) - return NULL; - - if (asprintf(&abspath, "%s/%s/", cwd, relpath) == -1) - return NULL; - - return abspath; -} - /* based on canonpath() from kern_pledge.c */ const struct got_error * got_canonpath(const char *input, char *buf, size_t bufsize)