[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: CVS update: x_compselect.c



  User: cnieves 
  Date: 07/04/21 07:15:39

  Modified:    .        x_compselect.c
  Log:
  Make the component selector filter case insensitive. Fix bug #1673589.
  
  * src/x_compselect.c: 
  
    Make the component selector filter case insensitive.
  
    Fixes bug #1673589. Thanks to Phil Endecott for reporting the  bug.
  
  
  
  
  Revision  Changes    Path
  1.17      +8 -1      eda/geda/gaf/gschem/src/x_compselect.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_compselect.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gschem/src/x_compselect.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -b -r1.16 -r1.17
  --- x_compselect.c	14 Apr 2007 19:47:25 -0000	1.16
  +++ x_compselect.c	21 Apr 2007 11:15:39 -0000	1.17
  @@ -312,6 +312,7 @@
   {
     Compselect *compselect = (Compselect*)data;
     gchar *compname;
  +  gchar *compname_upper=NULL, *text_upper=NULL;
     const gchar *text;
     gboolean ret;
   
  @@ -337,8 +338,14 @@
       gtk_tree_model_get (model, iter,
                           0, &compname,
                           -1);
  -    ret = (strstr (compname, text) != NULL);
  +    /* Do a case insensitive comparison, converting the strings 
  +       to uppercase */
  +    compname_upper = g_ascii_strup(compname, -1);
  +    text_upper = g_ascii_strup(text, -1);
  +    ret = (strstr (compname_upper, text_upper) != NULL);
       g_free (compname);
  +    g_free(compname_upper);
  +    g_free(text_upper);
     }
   
     return ret;
  
  
  


_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs