From 2e6d3853919d109ee4c44ae0dad8970cc85b38e2 Mon Sep 17 00:00:00 2001 From: Andrew Chilton Date: Thu, 3 Jul 2008 00:53:27 +1200 Subject: [PATCH] Fix bug related to only having one item in a config list (closes #a5b1eb37). --- issues/c_f09a77f4.cil | 9 +++++++++ issues/i_a5b1eb37.cil | 5 +++-- lib/CIL.pm | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 issues/c_f09a77f4.cil diff --git a/issues/c_f09a77f4.cil b/issues/c_f09a77f4.cil new file mode 100644 index 0000000..bf26521 --- /dev/null +++ b/issues/c_f09a77f4.cil @@ -0,0 +1,9 @@ +Issue: a5b1eb37 +CreatedBy: Andrew Chilton +Inserted: 2008-07-02T12:51:27 +Updated: 2008-07-02T12:52:08 + +This was happening because there was only one line for the StatusClosedList. +This would happen with some of the other List items too. + +Should be fixed now. diff --git a/issues/i_a5b1eb37.cil b/issues/i_a5b1eb37.cil index 6026852..6f41d03 100644 --- a/issues/i_a5b1eb37.cil +++ b/issues/i_a5b1eb37.cil @@ -1,9 +1,10 @@ Summary: Can't use string ("Finished") as an ARRAY ref while "strict refs" in use at /usr/share/perl5/CIL.pm line 227. -Status: New +Status: Finished CreatedBy: Nigel McNie AssignedTo: Nigel McNie +Comment: f09a77f4 Inserted: 2008-07-02T12:27:39 -Updated: 2008-07-02T12:28:51 +Updated: 2008-07-02T12:52:26 I get this error when running 'cil list --is-open' on my repo. diff --git a/lib/CIL.pm b/lib/CIL.pm index e2c9e64..ee85064 100644 --- a/lib/CIL.pm +++ b/lib/CIL.pm @@ -224,7 +224,8 @@ sub read_config_file { # for some things, make a hash out of them foreach my $hash_name ( @config_hashes ) { my $h = {}; - foreach my $thing ( @{$cfg->{"${hash_name}List"}} ) { + my @list = ref $cfg->{"${hash_name}List"} eq 'ARRAY' ? @{$cfg->{"${hash_name}List"}} : $cfg->{"${hash_name}List"}; + foreach my $thing ( @list ) { $h->{$thing} = 1; } $cfg->{$hash_name} = $h; -- 2.39.5