Bug#483898: vim-scripts: lbdbq.vim returns a warning message when lbdbq outputs non-standard line

Luca Invernizzi lucainvernizzir at trashmail.net
Sat May 31 23:03:38 UTC 2008


Package: vim-scripts
Version: 7.1.7
Severity: minor
Tags: patch


In the ldbdq.vim script, the  LbdbQuery(qstring) function returns:

	Error executing function LBDBCompleteFn..LbdbQuery:
	line    5:
	E684: out of bound index: 1
	Error executing function LBDBCompleteFn..LbdbQuery:
	line    5:
	E15: Invalid Espression: [ [fields[1], fields[0]] ]



This was caused  by bug #480356 , that made the "lbdbq: 25 matches" be on the second line instead of the first one. Example:

	$lbdbq joe
	"our" variable $ignorant masks earlier declaration in same scope at /usr/lib/lbdb/mutt_ldap_query line 53, <DATA> line 228.
	lbdbq: 25 matches


The error is generated in these two lines of the LbdbQuery function:

	let fields = split(line, "\t")
	let results += [ [fields[1], fields[0]] ]

There is no checking if fields[1] exists (i.e. len(fields)>1).


The error can be solved adding the check:

	let fields = split(line, "\t")
	if len(fields)>=2     
	let results += [ [fields[1], fields[0]] ]
	endif






-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (650, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.23.1415-drinat (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=it_IT, LC_CTYPE=it_IT (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

vim-scripts depends on no packages.

Versions of packages vim-scripts recommends:
ii  vim                          1:7.1.293-3 Vi IMproved - enhanced vi editor
ii  vim-addon-manager            0.4         manager of addons for the Vim edit
ii  vim-nox [vim]                1:7.1.293-3 Vi IMproved - enhanced vi editor
ii  lbdb		  	 0.35.1+nmu1

-- no debconf information





More information about the pkg-vim-maintainers mailing list