diff options
author | sobomax <sobomax@FreeBSD.org> | 2002-02-20 17:15:17 +0000 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2002-02-20 17:15:17 +0000 |
commit | 15a3a8ab24f8a76f5293cd91ac933fdcef2c61b3 (patch) | |
tree | 4e0f0b8808d993d52917f587a7bef76c505719c6 /usr.sbin | |
parent | 8b827e221ad7c232bcbf206eedf136b902313689 (diff) | |
download | FreeBSD-src-15a3a8ab24f8a76f5293cd91ac933fdcef2c61b3.zip FreeBSD-src-15a3a8ab24f8a76f5293cd91ac933fdcef2c61b3.tar.gz |
Make sortdeps() working with dependency lists containing one or no elements.
Submitted by: roam
MFC in: 1 week
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_install/lib/deps.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/pkg_install/lib/deps.c b/usr.sbin/pkg_install/lib/deps.c index ddb6da7..04f42b3 100644 --- a/usr.sbin/pkg_install/lib/deps.c +++ b/usr.sbin/pkg_install/lib/deps.c @@ -41,7 +41,10 @@ sortdeps(char **pkgs) int i, j, loop_cnt; int err_cnt = 0; - for (i = 0; pkgs[i]; i++) { + if (pkgs[0] == NULL || pkgs[1] == NULL) + return (0); + + for (i = 0; pkgs[i + 1]; i++) { /* * Check to see if any other package in pkgs[i+1:] depends * on pkgs[i] and swap those two packages if so. |