# \[Patch\] don't ignore return of g\_list\_append

**URL:** <https://www.ruby-forum.com/t/patch-dont-ignore-return-of-g-list-append/94623>\
**Category:** Ruby-Gnome 2\
**Created:** [May 9, 2006, 11:09am UTC](https://www.ruby-forum.com/t/patch-dont-ignore-return-of-g-list-append/94623 "2006-05-09T11:09:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [May 9, 2006, 11:09am UTC](https://www.ruby-forum.com/t/patch-dont-ignore-return-of-g-list-append/94623/1 "2006-05-09T11:09:43Z")

</div>

Hi,

Some code in rbglib\_completion ignores the return value of  
g\_list\_append,  
this might cause problems as the start of the list can move around.  
Attached  
trivial patch fixes this.

Sjoerd

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [May 9, 2006, 7:37pm UTC](https://www.ruby-forum.com/t/patch-dont-ignore-return-of-g-list-append/94623/2 "2006-05-09T19:37:50Z")

</div>

Hi,

On Tue, 9 May 2006 11:06:54 +0200  
removed\_email\_address@domain.invalid (Sjoerd S.) wrote:

> Hi,
> 
> Some code in rbglib\_completion ignores the return value of g\_list\_append,  
> this might cause problems as the start of the list can move around. Attached  
> trivial patch fixes this.

Could you show me a sample to explain this problem?

–  
.:% Masao M.[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

* * *

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [May 9, 2006, 9:36pm UTC](https://www.ruby-forum.com/t/patch-dont-ignore-return-of-g-list-append/94623/3 "2006-05-09T21:36:43Z")

</div>

On Wed, May 10, 2006 at 02:35:46AM +0900, Masao M. wrote:

> Hi,
> 
> On Tue, 9 May 2006 11:06:54 +0200  
> removed\_email\_address@domain.invalid (Sjoerd S.) wrote:
> 
> > Some code in rbglib\_completion ignores the return value of g\_list\_append,  
> > this might cause problems as the start of the list can move around.  
> > Attached trivial patch fixes this.
> 
> Could you show me a sample to explain this problem?

Sure. But while creating the example i noticed there was more wrong then  
the  
little (common) error i spotted initially. I’ve also added some  
Check\_Type  
calls to ensure the parameters are actually arrays. Updated patch  
attached.

For an example:  
require ‘glib2’

c = GLib::Completion.new

c.add\_items([“One”, “Two”, “Three”])  
p c.items.keys  
c.remove\_items([“Two”, “One”])  
p c.items.keys

p c.complete("")

Without the patch it outputs:  
[“Two”, “One”, “Three”]  
[“One”, “Three”]  
[[“Three”, “Two”, “One”], nil]

With the patch it gives the correct output:  
[“Two”, “One”, “Three”]  
[“Three”]  
[[“Three”], nil]

Sjoerd
