From 837426d7be63cf11d51b74464f174724935c5d4f Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Mon, 27 Mar 2023 15:59:41 -0600 Subject: [PATCH] ruby: filenames: return string array directly Signed-off-by: Felipe Contreras --- bindings/ruby/filenames.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bindings/ruby/filenames.c b/bindings/ruby/filenames.c index 17873393..20541402 100644 --- a/bindings/ruby/filenames.c +++ b/bindings/ruby/filenames.c @@ -23,7 +23,11 @@ VALUE notmuch_rb_filenames_get (notmuch_filenames_t *fnames) { - return Data_Wrap_Notmuch_Object (notmuch_rb_cFileNames, ¬much_rb_filenames_type, fnames); + VALUE rb_array = rb_ary_new (); + + for (; notmuch_filenames_valid (fnames); notmuch_filenames_move_to_next (fnames)) + rb_ary_push (rb_array, rb_str_new2 (notmuch_filenames_get (fnames))); + return rb_array; } /*