cvs commit: ALFS/nALFS/src nalfs.c

kpfleming at linuxfromscratch.org kpfleming at linuxfromscratch.org
Fri Mar 26 22:59:06 PST 2004


kpfleming    04/03/26 23:59:06

  Modified:    nALFS/src nalfs.c
  Log:
  optimize find_element_by_key now that its input will always be a simple number
  ensure that get_elements_package will not try to deference the root element's handler pointer
  
  Revision  Changes    Path
  1.53      +3 -7      ALFS/nALFS/src/nalfs.c
  
  Index: nalfs.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/nalfs.c,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- nalfs.c	22 Mar 2004 04:28:48 -0000	1.52
  +++ nalfs.c	27 Mar 2004 06:59:06 -0000	1.53
  @@ -483,7 +483,7 @@
   
   
   	for (p = el; p; p = p->parent) {
  -		if (p->handler->type & HTYPE_PACKAGE) {
  +		if (p->handler && (p->handler->type & HTYPE_PACKAGE)) {
   			break;
   		}
   	}
  @@ -688,13 +688,9 @@
   /* takes string containing element id and gets element */
   static element_s *find_element_by_key(const char *str)
   {
  -	char *endptr;
  -	unsigned int id = strtoul(str, &endptr, 10);
  +	unsigned int id = atoi(str);
   
  -	if (*endptr == 0)
  -		return get_element_by_id(id);
  -
  -	return NULL;
  +	return get_element_by_id(id);
   }
   
   static INLINE void send_element_status(const char *key)
  
  
  



More information about the alfs-log mailing list