slitaz-dev-tools rev 137

search.cgi: add loop detection in depends (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Dec 08 18:57:07 2011 +0100 (2011-12-08)
parents aeaf89486c18
children 8ce6c56c13a5
files tazpkg-web/search.cgi
line diff
     1.1 --- a/tazpkg-web/search.cgi	Thu Dec 08 17:47:18 2011 +0100
     1.2 +++ b/tazpkg-web/search.cgi	Thu Dec 08 18:57:07 2011 +0100
     1.3 @@ -374,8 +374,9 @@
     1.4  function chkloop(pkg, i, n)
     1.5  {
     1.6  	if (n < 12)
     1.7 -	for (i = 1; i < split(deps[pkg],curdep," "); i++) {
     1.8 +	for (i = 1; i <= split(deps[pkg],curdep," "); i++) {
     1.9  		if (curdep[i] == base || chkloop(curdep[i], 0, n+1)) {
    1.10 +			split(deps[pkg],curdep," ")
    1.11  			p = curdep[i] " " p
    1.12  			return 1
    1.13  		}