1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

Fix a bug in 1.40 - it missed three occurences in pkg_info which leads to

(null)/file output.

MFC after:	1 week
This commit is contained in:
Pav Lucistnik 2007-02-07 19:44:44 +00:00
parent 1d3aed33e8
commit 9486c31113
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166552

View File

@ -213,6 +213,7 @@ show_files(const char *title, Package *plist)
{
PackingList p;
Boolean ign = FALSE;
char *prefix = NULL;
const char *dir = ".";
if (!Quiet)
@ -227,7 +228,12 @@ show_files(const char *title, Package *plist)
break;
case PLIST_CWD:
dir = p->name;
if (!prefix)
prefix = p->name;
if (p->name == NULL)
dir = prefix;
else
dir = p->name;
break;
case PLIST_IGNORE:
@ -255,6 +261,7 @@ show_size(const char *title, Package *plist)
long blksize;
int headerlen;
char *descr;
char *prefix = NULL;
descr = getbsize(&headerlen, &blksize);
if (!Quiet)
@ -274,7 +281,12 @@ show_size(const char *title, Package *plist)
break;
case PLIST_CWD:
dir = p->name;
if (!prefix)
prefix = p->name;
if (p->name == NULL)
dir = prefix;
else
dir = p->name;
break;
case PLIST_IGNORE:
@ -301,15 +313,21 @@ show_cksum(const char *title, Package *plist)
{
PackingList p;
const char *dir = ".";
char *prefix = NULL;
char tmp[FILENAME_MAX];
if (!Quiet)
printf("%s%s", InfoPrefix, title);
for (p = plist->head; p != NULL; p = p->next)
if (p->type == PLIST_CWD)
dir = p->name;
else if (p->type == PLIST_FILE) {
if (p->type == PLIST_CWD) {
if (!prefix)
prefix = p->name;
if (p->name == NULL)
dir = prefix;
else
dir = p->name;
} else if (p->type == PLIST_FILE) {
snprintf(tmp, FILENAME_MAX, "%s/%s", dir, p->name);
if (!fexists(tmp))
warnx("%s doesn't exist", tmp);