Fix pkg_version with the -o argument to print the origin.

Submitted by:	Sebastian Stach <sebsta AT t-online DOT de>
MFC after:	3 days
This commit is contained in:
krion 2006-02-12 16:09:33 +00:00
parent f4f2eb1449
commit 0775d47dcc

View File

@ -261,11 +261,12 @@ show_version(Package plist, const char *latest, const char *source)
return;
if (ShowOrigin != FALSE)
strlcpy(tmp, plist.origin, PATH_MAX);
else
else {
strlcpy(tmp, plist.name, PATH_MAX);
if (!Verbose) {
if ((ch = strrchr(tmp, '-')) != NULL)
ch[0] = '\0';
if (!Verbose) {
if ((ch = strrchr(tmp, '-')) != NULL)
ch[0] = '\0';
}
}
if (latest == NULL) {
if (source == NULL && OUTPUT('!')) {