diff options
Diffstat (limited to 'pkgtools/pkg_install/files/lib')
-rw-r--r-- | pkgtools/pkg_install/files/lib/lib.h | 3 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/lib/plist.c | 18 |
2 files changed, 14 insertions, 7 deletions
diff --git a/pkgtools/pkg_install/files/lib/lib.h b/pkgtools/pkg_install/files/lib/lib.h index 48f4979c7f2..eca555493df 100644 --- a/pkgtools/pkg_install/files/lib/lib.h +++ b/pkgtools/pkg_install/files/lib/lib.h @@ -1,4 +1,4 @@ -/* $NetBSD: lib.h,v 1.42.2.13 2008/08/05 22:56:24 joerg Exp $ */ +/* $NetBSD: lib.h,v 1.42.2.14 2008/08/11 15:58:15 joerg Exp $ */ /* from FreeBSD Id: lib.h,v 1.25 1997/10/08 07:48:03 charnier Exp */ @@ -337,6 +337,7 @@ void write_plist(package_t *, FILE *, char *); void stringify_plist(package_t *, char **, size_t *, const char *); void parse_plist(package_t *, const char *); void read_plist(package_t *, FILE *); +void append_plist(package_t *, FILE *); int delete_package(Boolean, Boolean, package_t *, Boolean, const char *); /* Package Database */ diff --git a/pkgtools/pkg_install/files/lib/plist.c b/pkgtools/pkg_install/files/lib/plist.c index 63a5aab45a0..2b0bd10683d 100644 --- a/pkgtools/pkg_install/files/lib/plist.c +++ b/pkgtools/pkg_install/files/lib/plist.c @@ -1,4 +1,4 @@ -/* $NetBSD: plist.c,v 1.17.4.9 2008/08/10 22:09:38 joerg Exp $ */ +/* $NetBSD: plist.c,v 1.17.4.10 2008/08/11 15:58:15 joerg Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -11,7 +11,7 @@ #if 0 static const char *rcsid = "from FreeBSD Id: plist.c,v 1.24 1997/10/08 07:48:15 charnier Exp"; #else -__RCSID("$NetBSD: plist.c,v 1.17.4.9 2008/08/10 22:09:38 joerg Exp $"); +__RCSID("$NetBSD: plist.c,v 1.17.4.10 2008/08/11 15:58:15 joerg Exp $"); #endif #endif @@ -353,7 +353,7 @@ parse_plist(package_t *pkg, const char *buf) * Read a packing list from a file */ void -read_plist(package_t *pkg, FILE * fp) +append_plist(package_t *pkg, FILE * fp) { char pline[MaxPathSize]; char *cp; @@ -361,9 +361,6 @@ read_plist(package_t *pkg, FILE * fp) int len; int free_cp; - pkg->head = NULL; - pkg->tail = NULL; - while (fgets(pline, MaxPathSize, fp) != (char *) NULL) { for (len = strlen(pline); len && isspace((unsigned char) pline[len - 1]);) { @@ -392,6 +389,15 @@ read_plist(package_t *pkg, FILE * fp) } } +void +read_plist(package_t *pkg, FILE * fp) +{ + pkg->head = NULL; + pkg->tail = NULL; + + append_plist(pkg, fp); +} + /* * Write a packing list to a file, converting commands to ASCII equivs */ |