This commit is contained in:
simon987 2020-02-27 09:44:19 -05:00
parent d83fc2c373
commit 565ba6ee76

View File

@ -259,8 +259,10 @@ char *abspath(const char *path) {
if (abs == NULL) { if (abs == NULL) {
return NULL; return NULL;
} }
abs = realloc(abs, strlen(abs) + 2); if (strlen(abs) > 1) {
strcat(abs, "/"); abs = realloc(abs, strlen(abs) + 2);
strcat(abs, "/");
}
wordfree(&w); wordfree(&w);
return abs; return abs;