summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2002-05-02 13:09:33 +0000
committersobomax <sobomax@FreeBSD.org>2002-05-02 13:09:33 +0000
commitc6540d59a5550a45e14e799522f68ba0f9b5e522 (patch)
treeadb99b8fce153a3b2dde7db2f550a139ab1dd6f8 /usr.sbin
parent95a09c0851d805818c39950f9f3937901a15e3e6 (diff)
downloadFreeBSD-src-c6540d59a5550a45e14e799522f68ba0f9b5e522.zip
FreeBSD-src-c6540d59a5550a45e14e799522f68ba0f9b5e522.tar.gz
Make pkg_info working again when argument is a file not in the current
directory. PR: 37571 Submitted by: Dirk Meyer <dirk.meyer@dinoex.sub.org> MFC after: 1 week
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_install/info/main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/pkg_install/info/main.c b/usr.sbin/pkg_install/info/main.c
index ae62a38..807f960 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';
/*
OpenPOWER on IntegriCloud