Skip to content
Snippets Groups Projects
Commit 5d1daff1 authored by Andrea Censi's avatar Andrea Censi
Browse files

Bug with absolute filenames

parent 74a80773
No related branches found
No related tags found
No related merge requests found
......@@ -154,10 +154,15 @@ int options_parse_stream(struct option*ops, const char*pwd, FILE*file) {
int options_parse_file(struct option*ops, const char*pwd, const char*filename) {
char concat[PATH_MAX*2+1];
strcpy(concat, pwd);
strcat(concat, "/");
strcat(concat, filename);
if(filename[0] != '/') {
strcpy(concat, pwd);
strcat(concat, "/");
strcat(concat, filename);
} else {
strcpy(concat, filename);
}
char resolved_path[PATH_MAX];
char *resolved;
if(! (resolved = realpath(concat, resolved_path))) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment