file_hash_set_file_owner() strips the offline root path, so this reciprocal
function should do likewise. This makes behaviour consistent with and without
an offline root.
git-svn-id: http://opkg.googlecode.com/svn/trunk@534
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
pkg_t *
file_hash_get_file_owner(const char *file_name)
{
- return hash_table_get(&conf->file_hash, file_name);
+ if (conf->offline_root) {
+ unsigned int len = strlen(conf->offline_root);
+ if (strncmp(file_name, conf->offline_root, len) == 0) {
+ file_name += len;
+ }
+ }
+
+ return hash_table_get(&conf->file_hash, file_name);
}
void