diff --git a/src/libcglue/glue.c b/src/libcglue/glue.c index d0371656..38dabe9e 100755 --- a/src/libcglue/glue.c +++ b/src/libcglue/glue.c @@ -1193,32 +1193,6 @@ char *realpath(const char *path, char *resolved_path) return NULL; } - /* check the length of every component of path arg */ - char component[NAME_MAX + 1]; - const char *start = path; - const char *end; - while (*start != '\0') { - end = start; - - // find the next '/' - while (*end != '/' && *end != '\0') { end++; } - - // compute path component length - size_t len = end - start; - if (len > NAME_MAX) { - errno = ENAMETOOLONG; - return NULL; - } - - // copy start to component buffer - memcpy(component, start, len); - component[len] = '\0'; - - // move to the next component - if (*end == '/') { start = end + 1; } - else { start = end; } - } - /* check if file or directory exist */ struct stat st; if (stat(path, &st) == 0) {