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:
@@ -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>
|
Wed Oct 23 17:06:24 CEST 2002 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* Makefile.am libxslt.spec.in doc/Makefile.am: cleaned up
|
* Makefile.am libxslt.spec.in doc/Makefile.am: cleaned up
|
||||||
|
24
config.h.in
24
config.h.in
@@ -18,6 +18,9 @@
|
|||||||
/* Define to 1 if you have the <float.h> header file. */
|
/* Define to 1 if you have the <float.h> header file. */
|
||||||
#undef HAVE_FLOAT_H
|
#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. */
|
/* Define to 1 if you have the <fp_class.h> header file. */
|
||||||
#undef HAVE_FP_CLASS_H
|
#undef HAVE_FP_CLASS_H
|
||||||
|
|
||||||
@@ -51,6 +54,18 @@
|
|||||||
/* Define to 1 if you have the <nan.h> header file. */
|
/* Define to 1 if you have the <nan.h> header file. */
|
||||||
#undef HAVE_NAN_H
|
#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. */
|
/* Define to 1 if you have the `stat' function. */
|
||||||
#undef HAVE_STAT
|
#undef HAVE_STAT
|
||||||
|
|
||||||
@@ -90,6 +105,15 @@
|
|||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
/* Define to 1 if you have the <unistd.h> header file. */
|
||||||
#undef HAVE_UNISTD_H
|
#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. */
|
/* Define to 1 if you have the `_stat' function. */
|
||||||
#undef HAVE__STAT
|
#undef HAVE__STAT
|
||||||
|
|
||||||
|
15
configure.in
15
configure.in
@@ -121,6 +121,21 @@ AC_CHECK_FUNC(fabs, , AC_CHECK_LIB(m, fabs,
|
|||||||
AC_CHECK_FUNCS(gettimeofday)
|
AC_CHECK_FUNCS(gettimeofday)
|
||||||
AC_CHECK_FUNCS(mktime localtime asctime time gmtime ftime)
|
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
|
||||||
dnl Perl is just needed for generating some data for XSLtmark
|
dnl Perl is just needed for generating some data for XSLtmark
|
||||||
dnl
|
dnl
|
||||||
|
@@ -65,6 +65,18 @@ extern "C" {
|
|||||||
#define DEBUG_MEMORY_LOCATION
|
#define DEBUG_MEMORY_LOCATION
|
||||||
#endif
|
#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:
|
* WITH_XSLT_DEBUGGER:
|
||||||
*
|
*
|
||||||
|
@@ -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) { \
|
#define XSLT_GET_VAR_STR(msg, str) { \
|
||||||
int size; \
|
int size; \
|
||||||
int chars; \
|
int chars; \
|
||||||
|
@@ -175,10 +175,10 @@ xsltprocExternalEntityLoader(const char *URL, const char *ID,
|
|||||||
xmlChar *newURL;
|
xmlChar *newURL;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
len = xmlStrlen(paths[i]) + xmlStrlen(BAD_CAST URL) + 5;
|
newURL = xmlStrdup((const xmlChar *) paths[i]);
|
||||||
newURL = xmlMalloc(len);
|
newURL = xmlStrcat(newURL, (const xmlChar *) "/");
|
||||||
|
newURL = xmlStrcat(newURL, (const xmlChar *) URL);
|
||||||
if (newURL != NULL) {
|
if (newURL != NULL) {
|
||||||
snprintf(newURL, len, "%s/%s", paths[i], URL);
|
|
||||||
ret = defaultEntityLoader((const char *)newURL, ID, ctxt);
|
ret = defaultEntityLoader((const char *)newURL, ID, ctxt);
|
||||||
xmlFree(newURL);
|
xmlFree(newURL);
|
||||||
if (ret != NULL) {
|
if (ret != NULL) {
|
||||||
|
Reference in New Issue
Block a user