Project

General

Profile

« Previous | Next » 

Revision 10822

lib/sh/util.sh: is_array(): handle unset vars (=false). this fixes a bug in pg_export_table_no_header, which produced the error "lib/sh/util.sh: line 290: declare: cols: not found".

View differences:

util.sh
284 284
	return 1
285 285
}
286 286

  
287
is_array()
287
is_array() # handles unset vars (=false)
288 288
{
289
	isset "$1" || return 1
289 290
	local decl; decl="$(declare -p "$1")" || return; echo_vars decl
290 291
	starts_with 'declare -a' "$decl" # also matches -ax
291 292
}

Also available in: Unified diff