diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2014-07-19 08:55:48 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2014-07-19 08:55:48 +0000 |
commit | 7476d56c90ba515f4433305b46d68b988ca1e334 (patch) | |
tree | 8179feb696cb8234973e66451a748f25a4931971 /libgphoto2_port | |
parent | d4dee7c8fd40dca22ab5b59415616172b9dad048 (diff) | |
download | libgphoto2-7476d56c90ba515f4433305b46d68b988ca1e334.tar.gz |
From: Axel Waggershauser <awagger@web.de>
Subject: Patch for gp_port_library_list return value
Bottom line: this 'index' which is not an index even according to it's
own documentation gets never used anywhere. It is only incorrectly
interpreted as an error code.
The attached patch changes the documentation and the code of
gp_port_info_list_append to make it behave like all the calling code
thinks it would.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15076 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2_port')
-rw-r--r-- | libgphoto2_port/libgphoto2_port/gphoto2-port-info-list.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/libgphoto2_port/libgphoto2_port/gphoto2-port-info-list.c b/libgphoto2_port/libgphoto2_port/gphoto2-port-info-list.c index 9e2f8c3a9..30537aec6 100644 --- a/libgphoto2_port/libgphoto2_port/gphoto2-port-info-list.c +++ b/libgphoto2_port/libgphoto2_port/gphoto2-port-info-list.c @@ -172,14 +172,11 @@ gp_port_info_list_free (GPPortInfoList *list) * against info.path and - if successfull - will append this entry to the * list. * - * \note This returns index - number of generic entries, not the correct index. - * - * \return A non-negative number or a gphoto2 error code + * \return A gphoto2 error code **/ int gp_port_info_list_append (GPPortInfoList *list, GPPortInfo info) { - unsigned int generic, i; GPPortInfo *new_info; CHECK_NULL (list); @@ -197,11 +194,7 @@ gp_port_info_list_append (GPPortInfoList *list, GPPortInfo info) list->info[list->count - 1] = info; - /* Ignore generic entries */ - for (generic = i = 0; i < list->count; i++) - if (!strlen (list->info[i]->name)) - generic++; - return (list->count - 1 - generic); + return GP_OK; } |