Merge pull request #36 from mariano-lopez/master

util.c: Change logic in cve_get_file_parent()
This commit is contained in:
Ikey Doherty
2016-02-22 01:18:22 +00:00
+3 -5
View File
@@ -184,11 +184,9 @@ bool cve_is_dir(const char *p)
char *cve_get_file_parent(const char *p)
{
char *r = realpath(p, NULL);
if (!r) {
return NULL;
}
return dirname(r);
autofree(char) *d = strdup(p);
char *r = realpath(dirname(d), NULL);
return r;
}
bool cve_file_set_text(const char *path, char *text)