]> git.mjollnir.org Git - cil.git/commitdiff
Fix bug related to only having one item in a config list (closes #a5b1eb37).
authorAndrew Chilton <andychilton@gmail.com>
Wed, 2 Jul 2008 12:53:27 +0000 (00:53 +1200)
committerAndrew Chilton <andychilton@gmail.com>
Wed, 2 Jul 2008 12:53:27 +0000 (00:53 +1200)
issues/c_f09a77f4.cil [new file with mode: 0644]
issues/i_a5b1eb37.cil
lib/CIL.pm

diff --git a/issues/c_f09a77f4.cil b/issues/c_f09a77f4.cil
new file mode 100644 (file)
index 0000000..bf26521
--- /dev/null
@@ -0,0 +1,9 @@
+Issue: a5b1eb37
+CreatedBy: Andrew Chilton <andychilton@gmail.com>
+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.
index 60268522ddce5aa99a3670c699d5ac2028a9a71e..6f41d03bc583ce07a26db72649889f8d03b0331c 100644 (file)
@@ -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 <nigel@mcnie.name>
 AssignedTo: Nigel McNie <nigel@mcnie.name>
+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.
 
index e2c9e649732213f937390d62392c8a758e75487a..ee850644928c82a0c7f7d4866aeb279c6032d2e8 100644 (file)
@@ -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;