This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gconv_trans tweak



The open_count member of `struct known_trans' is not yet used, but when it
will, it should be incremented in __gconv_translit_find.

Also, when storing in the hash table an entry for a module that wasn't
found, it seems better to clear the filename, not only the handle.


2000-09-03  Bruno Haible  <haible@clisp.cons.org>

	* iconv/gconv_trans.c (__gconv_translit_find): Update open_count.
	Set fname to NULL if the module wasn't found.

*** glibc-20000831/iconv/gconv_trans.c.bak	Mon Aug 28 13:34:25 2000
--- glibc-20000831/iconv/gconv_trans.c	Sat Sep  2 16:52:59 2000
***************
*** 330,335 ****
--- 330,336 ----
  	    {
  	      /* Copy the data.  */
  	      *trans = (*found)->info;
+ 	      (*found)->open_count++;
  	      res = 0;
  	    }
  	}
***************
*** 366,372 ****
  
  	  newp->fname = cp;
  
! 	  /* Seach in all the directories.  */
  	  for (runp = __gconv_path_elem; runp->name != NULL; ++runp)
  	    {
  	      cp = __mempcpy (__stpcpy ((char *) newp->fname, runp->name),
--- 367,373 ----
  
  	  newp->fname = cp;
  
! 	  /* Search in all the directories.  */
  	  for (runp = __gconv_path_elem; runp->name != NULL; ++runp)
  	    {
  	      cp = __mempcpy (__stpcpy ((char *) newp->fname, runp->name),
***************
*** 381,386 ****
--- 382,390 ----
  		  break;
  		}
  	    }
+ 
+ 	  if (res)
+ 	    newp->fname = NULL;
  
  	  /* In any case we'll add the entry to our search tree.  */
  	  if (__tsearch (newp, &search_tree, trans_compare) == NULL)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]