cvs commit: ALFS/nALFS/src libXML-tree.c

kpfleming at linuxfromscratch.org kpfleming at linuxfromscratch.org
Sun Mar 21 10:50:44 PST 2004


kpfleming    04/03/21 11:50:44

  Modified:    nALFS/src libXML-tree.c
  Log:
  cleanup version checking code
  
  Revision  Changes    Path
  1.27      +10 -24    ALFS/nALFS/src/libXML-tree.c
  
  Index: libXML-tree.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/libXML-tree.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- libXML-tree.c	21 Mar 2004 18:40:32 -0000	1.26
  +++ libXML-tree.c	21 Mar 2004 18:50:44 -0000	1.27
  @@ -373,38 +373,24 @@
   	return dotted_version;
   }
   
  -static const char *get_libxml_version(void)
  -{
  -	if (strcmp(xmlParserVersion, LIBXML_VERSION_STRING) == 0) {
  -		return make_dotted_version(xmlParserVersion);
  -	} else {
  -		const char *compiled;
  -		const char *installed;
  -		char *result = NULL;
  -
  -		compiled = make_dotted_version(LIBXML_VERSION_STRING);
  -		installed = make_dotted_version(xmlParserVersion);
  -		append_str_format(&result, "%s (compiled against %s)",
  -				  installed, compiled);
  -		xfree(compiled);
  -		xfree(installed);
  -		return result;
  -	}
  -}
  -
   void init_libXML_tree(void)
   {
  -	const char *xml_version;
  -
   	xmlSetGenericErrorFunc(NULL, handle_error);
   
   	LIBXML_TEST_VERSION;
   
   	xmlSubstituteEntitiesDefault(1);
   
  -	xml_version = get_libxml_version();
  -	Nprint("Using libXML2, version %s.", xml_version);
  -	xfree(xml_version);
  +	if (strcmp(xmlParserVersion, LIBXML_VERSION_STRING) == 0) {
  +		Nprint("Using libXML2, version %s.", LIBXML_DOTTED_VERSION);
  +	} else {
  +		const char *installed;
  +
  +		installed = make_dotted_version(xmlParserVersion);
  +		Nprint_warn("Using libXML2, version %s (compiled against %s).",
  +			    installed, LIBXML_DOTTED_VERSION);
  +		xfree(installed);
  +	}
   }
   
   /*
  
  
  



More information about the alfs-log mailing list