From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Barada Date: Tue, 05 Apr 2011 00:44:49 -0400 Subject: [U-Boot] env: fix env var autocompletion In-Reply-To: <201104042153.16448.vapier@gentoo.org> References: <20110404201745.3ffc30cb.kim.phillips@freescale.com> <201104042153.16448.vapier@gentoo.org> Message-ID: <4D9A9E41.9000901@logicpd.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > On Monday, April 04, 2011 21:17:45 Kim Phillips wrote: >> commit 560d424b6d7cd4205b062ad95f1b104bd4f8bcc3 "env: re-add >> support for auto-completion" fell short of its description - >> the 'used' logic in hmatch_r was reversed - 'used' is 0 if >> the hash table entry is not used, or -1 if deleted. This >> patch makes hmatch_r actually match on valid ('used') entries, >> instead of skipping them and failing to match anything. > i dont think my commit is wrong. i think the bug you describe was actually > added in c81c1222427f268d29ba999c82e2477c428e7bab. You're right; I accidentally inverted the condition in my patch; it orignally was: if (!htab->table[idx].used) continue; Since a deleted entry is now -1 (and an unused entry is zero), the condition should have been: if (htab->table[idx].used <= 0) continue; not: if (htab->table[idx].used > 0) continue; > -mike -- Peter Barada peter.barada at logicpd.com