diff options
Diffstat (limited to 'abspath.c')
-rw-r--r-- | abspath.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -41,7 +41,7 @@ static const char *real_path_internal(const char *path, int die_on_error) * here so that we can chdir() back to it at the end of the * function: */ - char cwd[1024] = ""; + static char cwd[PATH_MAX]; int buf_index = 1; @@ -49,6 +49,8 @@ static const char *real_path_internal(const char *path, int die_on_error) char *last_elem = NULL; struct stat st; + *cwd = '\0'; + /* We've already done it */ if (path == buf || path == next_buf) return path; |