cvs commit: ALFS/nALFS/src handlers.c

kpfleming at linuxfromscratch.org kpfleming at linuxfromscratch.org
Fri Feb 27 21:55:21 PST 2004


kpfleming    04/02/27 22:55:21

  Modified:    nALFS/src handlers.c
  Log:
  add option_in_string searching function
  
  Revision  Changes    Path
  1.26      +14 -0     ALFS/nALFS/src/handlers.c
  
  Index: handlers.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers.c,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- handlers.c	25 Feb 2004 03:55:34 -0000	1.25
  +++ handlers.c	28 Feb 2004 05:55:21 -0000	1.26
  @@ -484,6 +484,20 @@
   	return xstrdup("sh");
   }
   
  +int option_in_string(const char * const option, const char * const string)
  +{
  +	const char *tmp;
  +	const char *tok;
  +
  +	tmp = xstrdup(string);
  +	for (tok = strtok(tmp, WHITE_SPACE); tok; tok = strtok(NULL, WHITE_SPACE)) {
  +		if (strcmp(option, tok) == 0)
  +			break;
  +	}
  +	xfree(tmp);
  +	return tok ? 1 : 0;
  +}
  +
   /* Used by the old syntax (2.0). */
   int option_exists(const char *option, element_s *element)
   {
  
  
  



More information about the alfs-log mailing list