/* download package and dependencies */
for (i = 0; i < deps->len; i++) {
pkg_t *pkg;
- char *url;
+ char *url, *urlencoded_path;
pkg = deps->pkgs[i];
if (pkg_get_string(pkg, PKG_LOCAL_FILENAME))
}
filename = pkg_get_string(pkg, PKG_FILENAME);
-
- sprintf_alloc(&url, "%s/%s", pkg->src->value, filename);
+ urlencoded_path = urlencode_path(filename);
+ sprintf_alloc(&url, "%s/%s", pkg->src->value, urlencoded_path);
+ free(urlencoded_path);
/* Get the filename part, without any directory */
stripped_filename = strrchr(filename, '/');
char *url;
char *local_filename;
char *stripped_filename;
+ char *urlencoded_path;
char *filename;
if (pkg->src == NULL) {
return -1;
}
- sprintf_alloc(&url, "%s/%s", pkg->src->value, filename);
+ urlencoded_path = urlencode_path(filename);
+ sprintf_alloc(&url, "%s/%s", pkg->src->value, urlencoded_path);
+ free(urlencoded_path);
/* The filename might be something like
"../../foo.opk". While this is correct, and exactly what we