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

Make sortdeps() working with dependency lists containing one or no elements.

Submitted by:	roam
MFC in:		1 week
This commit is contained in:
Maxim Sobolev 2002-02-20 17:15:17 +00:00
parent 68dfd6b46a
commit db6c6159b0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=90987

View File

@ -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.