swig/device.swg in rbcdio-0.03 vs swig/device.swg in rbcdio-0.04

- old
+ new

@@ -1,7 +1,7 @@ /* -*- c -*- - $Id: device.swg,v 1.12 2008/05/02 13:05:40 karl Exp $ + $Id: device.swg,v 1.13 2008/11/30 15:45:23 rocky Exp $ Copyright (C) 2006, 2007, 2008 Rocky Bernstein <rocky@gnu.org> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,12 +29,12 @@ typedef char ** DeviceList_t; %} %typemap(out) DeviceList_t { // $1 is of type DeviceList_t - char **p = result; + char **p = result; - if (result) { + if (result && *result) { VALUE aDevices = rb_ary_new(); for (p = $1; *p; p++) { rb_ary_push(aDevices, rb_str_new2(*p)); } cdio_free_device_list($1);