From 3d5c1511ca0ec8f72ebdfc749fbac99da4f2f48c Mon Sep 17 00:00:00 2001 From: Maxim Sobolev Date: Thu, 2 May 2002 13:09:33 +0000 Subject: [PATCH] Make pkg_info working again when argument is a file not in the current directory. PR: 37571 Submitted by: Dirk Meyer MFC after: 1 week --- usr.sbin/pkg_install/info/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr.sbin/pkg_install/info/main.c b/usr.sbin/pkg_install/info/main.c index ae62a38d554..807f9608c7e 100644 --- a/usr.sbin/pkg_install/info/main.c +++ b/usr.sbin/pkg_install/info/main.c @@ -187,8 +187,11 @@ main(int argc, char **argv) /* Get all the remaining package names, if any */ while (*argv) { - /* Don't try to apply heuristics if arguments are regexs */ - if (MatchType != MATCH_REGEX) + /* + * Don't try to apply heuristics if arguments are regexs or if + * the argument refers to an existing file. + */ + if (MatchType != MATCH_REGEX && !isfile(*argv)) while ((pkgs_split = strrchr(*argv, (int)'/')) != NULL) { *pkgs_split++ = '\0'; /*