-@@ -238,15 +243,13 @@ void store_package(uint32_t package_no, struct pkg *pkg, struct tndb *db,
-
- if (required) {
- n_buf_clean(nbuf);
-- n_buf_printf(nbuf, "/"); /* prefix all by '/' */
-- nbuf = dirarray_join(nbuf, required, ":/");
-+ nbuf = dirarray_join(nbuf, required, ":");
- tndb_put(db, key, klen, n_buf_ptr(nbuf), n_buf_size(nbuf));
- }
-
- if (owned) {
- n_buf_clean(nbuf);
-- n_buf_printf(nbuf, "/"); /* prefix all by '/' */
-- nbuf = dirarray_join(nbuf, owned, ":/");
-+ nbuf = dirarray_join(nbuf, owned, ":");
-
- /* ugly, but what for another package_key() call */
- key[1] = PREFIX_PKGKEY_OWNDIR;
-@@ -323,9 +326,13 @@ static int dirindex_create(const struct pkgdir *pkgdir, const char *path,
- for (i=0; i < n_array_size(directories); i++) {
- const char *path = n_array_nth(directories, i);
- tn_array *ids = n_hash_get(path_index, path);
-+ int j;
-
- n_buf_clean(nbuf);
-- nbuf = dirarray_join(nbuf, ids, ":");
-+ for (j = 0; j < n_array_size(ids); j++) {
-+ n_buf_printf(nbuf, "%s%s", (char *)n_array_nth(ids, j),
-+ j < n_array_size(ids) - 1 ? ":" : "");
-+ }
-
- DBGF(" dir %s %s\n", path, (char*)n_buf_ptr(nbuf));
-
-@@ -774,11 +781,11 @@ tn_array *get_package_directories_as_array(const struct pkgdir *pkgdir,
-
- dirs = n_array_new(n, free, (tn_fn_cmp)strcmp);
- while (*tl) {
-- if (**tl)
-+ if (**tl)
- n_array_push(dirs, n_strdup(*tl));
- tl++;
- }
--
-+
- n_str_tokl_free(tl_save);
- n_free(val);
-
-@@ -809,7 +816,7 @@ static tn_array *do_dirindex_get(const struct pkgdir_dirindex *dirindex,
- unsigned char val[8192];
- int n, found, pkgs_passsed = 1;