From 76868db1d69243ee4ec94868bd05a227e8b720ae Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Thu, 30 Oct 2008 20:12:50 +0000 Subject: [PATCH] * List drivers as a Hash --- ruby/caca-display.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ruby/caca-display.c b/ruby/caca-display.c index eaf0a69..97d717b 100644 --- a/ruby/caca-display.c +++ b/ruby/caca-display.c @@ -26,7 +26,7 @@ void display_free(void *display) static VALUE display_alloc(VALUE klass) { VALUE obj; - obj = Data_Wrap_Struct(klass, 0, display_free, NULL); + obj = Data_Wrap_Struct(klass, 0, display_free, NULL); return obj; } @@ -230,14 +230,14 @@ static VALUE driver_list(void) { VALUE ary; char const* const* list; - + list = caca_get_display_driver_list(); - - ary = rb_ary_new(); - while (*list != NULL) + + ary = rb_hash_new(); + while (*list != NULL && *(list+1) != NULL) { - rb_ary_push(ary, rb_str_new2(*list)); - list++; + rb_hash_aset(ary, rb_str_new2(*list), rb_str_new2(*(list+1))); + list+=2; } return ary;