enum pakfire_digests digest = PAKFIRE_DIGEST_NONE;
const char* hexdigest = pakfire_package_get_hexdigest(pkg, &digest);
- if (!hexdigest || strlen(hexdigest) < 3)
- return 1;
+ if (hexdigest && strlen(hexdigest) >= 3)
+ return pakfire_make_cache_path(pkg->pakfire, pkg->path,
+ "%c%c/%s/%s", hexdigest[0], hexdigest[1], hexdigest + 2, filename);
- return pakfire_make_cache_path(pkg->pakfire, pkg->path,
- "%c%c/%s/%s", hexdigest[0], hexdigest[1], hexdigest + 2, filename);
+ return pakfire_make_cache_path(pkg->pakfire, pkg->path, "%s", filename);
}
PAKFIRE_EXPORT const char* pakfire_package_get_path(struct pakfire_package* pkg) {