From c3a5cdab432bdf3d5192cfee9fc4130bb6d19296 Mon Sep 17 00:00:00 2001 From: Lutz Mueller Date: Tue, 16 Oct 2001 21:18:34 +0000 Subject: [PATCH] =?UTF-8?q?2001-10-16=20=20Lutz=20M=EF=BF=BDller=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch from Dan Fandrich <: * libgphoto2/gphoto2-abilities-list.c: * libgphoto2/gphoto2-camera.c: Make models case-insensitive. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@2568 67ed7778-7388-44ab-90cf-0a291f65f57c --- ChangeLog | 9 ++++++++- libgphoto2/gphoto2-abilities-list.c | 6 +++--- libgphoto2/gphoto2-camera.c | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6213eeb1c..9ab52e0c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,11 @@ -2001-10-17 Lutz Müller +2001-10-16 Lutz Müller + + Patch from Dan Fandrich <: + + * libgphoto2/gphoto2-abilities-list.c: + * libgphoto2/gphoto2-camera.c: Make models case-insensitive. + +2001-10-16 Lutz Müller * libgphoto2/gphoto2-camera.[c,h]: Documented diff --git a/libgphoto2/gphoto2-abilities-list.c b/libgphoto2/gphoto2-abilities-list.c index 4f30030a6..1ec7bbc47 100644 --- a/libgphoto2/gphoto2-abilities-list.c +++ b/libgphoto2/gphoto2-abilities-list.c @@ -290,8 +290,8 @@ gp_abilities_list_sort (CameraAbilitiesList *list) for (x = 0; x < list->count - 1; x++) for (y = x + 1; y < list->count; y++) - if (strcmp (list->abilities[x]->model, - list->abilities[y]->model) > 0) { + if (strcasecmp (list->abilities[x]->model, + list->abilities[y]->model) > 0) { t = list->abilities[x]; list->abilities[x] = list->abilities[y]; list->abilities[y] = t; @@ -336,7 +336,7 @@ gp_abilities_list_lookup_model (CameraAbilitiesList *list, const char *model) CHECK_NULL (list && model); for (x = 0; x < list->count; x++) - if (!strcmp (list->abilities[x]->model, model)) + if (!strcasecmp (list->abilities[x]->model, model)) return (x); return (GP_ERROR_MODEL_NOT_FOUND); diff --git a/libgphoto2/gphoto2-camera.c b/libgphoto2/gphoto2-camera.c index c54748621..e90aa1bb0 100644 --- a/libgphoto2/gphoto2-camera.c +++ b/libgphoto2/gphoto2-camera.c @@ -665,7 +665,7 @@ gp_camera_init (Camera *camera) * If the port or the model hasn't been indicated, try to * figure it out (USB only). Beware of "Directory Browse". */ - if (strcmp (camera->abilities->model, "Directory Browse")) { + if (strcasecmp (camera->abilities->model, "Directory Browse")) { if (!camera->port || !strcmp ("", camera->abilities->model)) { /* Call auto-detect and choose the first camera */