aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Sobolev <sobomax@FreeBSD.org>2002-09-09 08:00:32 +0000
committerMaxim Sobolev <sobomax@FreeBSD.org>2002-09-09 08:00:32 +0000
commitd4f82fcf34a5fd829021280277734a2fc112ddf4 (patch)
tree581c018d17748d977b8c193a9abfc7e28182d3f9
parent6478b242d66c727e0bb26fd7d524dfc0f7bfb8ff (diff)
Notes
-rw-r--r--usr.sbin/pkg_install/version/perform.c11
-rw-r--r--usr.sbin/pkg_install/version/version.h4
2 files changed, 11 insertions, 4 deletions
diff --git a/usr.sbin/pkg_install/version/perform.c b/usr.sbin/pkg_install/version/perform.c
index efc4dffae77ec..fa71dfb86982b 100644
--- a/usr.sbin/pkg_install/version/perform.c
+++ b/usr.sbin/pkg_install/version/perform.c
@@ -68,6 +68,8 @@ pkg_perform(char **indexarg)
i = -1;
while (pkgs[++i] != NULL) {
if (MatchName == NULL || strstr(pkgs[i], MatchName))
+ if (strcmp(pkgs[i], "mpeg_lib-1.3.1") == 0)
+ printf("Found!\n");
err_cnt += pkg_do(pkgs[i]);
}
@@ -75,6 +77,10 @@ pkg_perform(char **indexarg)
while (!SLIST_EMPTY(&Index)) {
ie = SLIST_FIRST(&Index);
SLIST_REMOVE_HEAD(&Index, next);
+ if (ie->name != NULL)
+ free(ie->name);
+ if (ie->origin != NULL)
+ free(ie->origin);
free(ie);
}
if (IndexFile != NULL)
@@ -157,8 +163,9 @@ pkg_do(char *pkg)
errx(2, "The INDEX does not appear to be valid!");
if ((ie = malloc(sizeof(struct index_entry))) == NULL)
errx(2, "Unable to allocate memory in %s.", __func__);
- strlcpy(ie->name, tmp, PATH_MAX);
- strlcpy(ie->origin, &ch[1], PATH_MAX);
+ bzero(ie, sizeof(struct index_entry));
+ ie->name = strdup(tmp);
+ ie->origin = strdup(&ch[1]);
/* Who really cares if we reverse the index... */
SLIST_INSERT_HEAD(&Index, ie, next);
}
diff --git a/usr.sbin/pkg_install/version/version.h b/usr.sbin/pkg_install/version/version.h
index 6ed65116308b0..daaebb0e97b4b 100644
--- a/usr.sbin/pkg_install/version/version.h
+++ b/usr.sbin/pkg_install/version/version.h
@@ -32,8 +32,8 @@
struct index_entry {
SLIST_ENTRY(index_entry) next;
- char name[PATH_MAX];
- char origin[PATH_MAX];
+ char *name;
+ char *origin;
};
SLIST_HEAD(index_head, index_entry);