Progress..
This commit is contained in:
@@ -90,6 +90,19 @@ unsigned long hash(const char *str) {
|
||||
return hash;
|
||||
}
|
||||
|
||||
char * joinpath(const char *base_url, const char *path) {
|
||||
static char result[1024];
|
||||
result[0] = '\0';
|
||||
strcat(result, base_url);
|
||||
if(base_url[strlen(base_url) - 1] != '/') {
|
||||
strcat(result, "/");
|
||||
}
|
||||
if(path[0] == '/') {
|
||||
path++;
|
||||
}
|
||||
strcat(result, path);
|
||||
return result;
|
||||
}
|
||||
|
||||
char *read_file(const char *path) {
|
||||
char *expanded_path = expand_home_directory(path);
|
||||
|
||||
Reference in New Issue
Block a user