1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-08-08 21:42:07 +03:00

remove the use of snprintf, and use libxml2 string API instead. try to

* xsltproc/xsltproc.c: remove the use of snprintf, and use
  libxml2 string API instead.
* configure.in libxslt/xsltconfig.h.in libxslt/xsltutils.c:
  try to cope with architecture lacking some of the string functions,
  reuse the trio ones compiled in libxml2 , should close #97113
Daniel
This commit is contained in:
Daniel Veillard
2002-11-04 17:04:59 +00:00
parent 272ea49e69
commit d7627fbf78
6 changed files with 66 additions and 3 deletions

View File

@@ -1,3 +1,11 @@
Mon Nov 4 06:55:36 CET 2002 Daniel Veillard <daniel@veillard.com>
* xsltproc/xsltproc.c: remove the use of snprintf, and use
libxml2 string API instead.
* configure.in libxslt/xsltconfig.h.in libxslt/xsltutils.c:
try to cope with architecture lacking some of the string functions,
reuse the trio ones compiled in libxml2 , should close #97113
Wed Oct 23 17:06:24 CEST 2002 Daniel Veillard <daniel@veillard.com>
* Makefile.am libxslt.spec.in doc/Makefile.am: cleaned up

View File

@@ -18,6 +18,9 @@
/* Define to 1 if you have the <float.h> header file. */
#undef HAVE_FLOAT_H
/* Define to 1 if you have the `fprintf' function. */
#undef HAVE_FPRINTF
/* Define to 1 if you have the <fp_class.h> header file. */
#undef HAVE_FP_CLASS_H
@@ -51,6 +54,18 @@
/* Define to 1 if you have the <nan.h> header file. */
#undef HAVE_NAN_H
/* Define to 1 if you have the `printf' function. */
#undef HAVE_PRINTF
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
/* Define to 1 if you have the `sprintf' function. */
#undef HAVE_SPRINTF
/* Define to 1 if you have the `sscanf' function. */
#undef HAVE_SSCANF
/* Define to 1 if you have the `stat' function. */
#undef HAVE_STAT
@@ -90,6 +105,15 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `vfprintf' function. */
#undef HAVE_VFPRINTF
/* Define to 1 if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF
/* Define to 1 if you have the `vsprintf' function. */
#undef HAVE_VSPRINTF
/* Define to 1 if you have the `_stat' function. */
#undef HAVE__STAT

View File

@@ -121,6 +121,21 @@ AC_CHECK_FUNC(fabs, , AC_CHECK_LIB(m, fabs,
AC_CHECK_FUNCS(gettimeofday)
AC_CHECK_FUNCS(mktime localtime asctime time gmtime ftime)
dnl Checking the standard string functions availability
AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,,
NEED_TRIO=1)
dnl
dnl Check for trio string functions
dnl
if test "${NEED_TRIO}" = "1" ; then
echo Reusing trio library for string functions
WITH_TRIO=1
else
WITH_TRIO=0
fi
AC_SUBST(WITH_TRIO)
dnl
dnl Perl is just needed for generating some data for XSLtmark
dnl

View File

@@ -65,6 +65,18 @@ extern "C" {
#define DEBUG_MEMORY_LOCATION
#endif
/**
* XSLT_NEED_TRIO:
*
* should be activated in the existing libc library lacks some of the
* string formatting function, in that case reuse the Trio ones already
* compiled in the libxml2 library.
*/
#if @WITH_TRIO@
#define XSLT_NEED_TRIO
#endif
/**
* WITH_XSLT_DEBUGGER:
*

View File

@@ -254,6 +254,10 @@ xsltMessage(xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst) {
* *
************************************************************************/
#ifdef XSLT_NEED_TRIO
#define vsnprintf trio_vsnprintf
#endif
#define XSLT_GET_VAR_STR(msg, str) { \
int size; \
int chars; \

View File

@@ -175,10 +175,10 @@ xsltprocExternalEntityLoader(const char *URL, const char *ID,
xmlChar *newURL;
int len;
len = xmlStrlen(paths[i]) + xmlStrlen(BAD_CAST URL) + 5;
newURL = xmlMalloc(len);
newURL = xmlStrdup((const xmlChar *) paths[i]);
newURL = xmlStrcat(newURL, (const xmlChar *) "/");
newURL = xmlStrcat(newURL, (const xmlChar *) URL);
if (newURL != NULL) {
snprintf(newURL, len, "%s/%s", paths[i], URL);
ret = defaultEntityLoader((const char *)newURL, ID, ctxt);
xmlFree(newURL);
if (ret != NULL) {