pgindent run on xml.c in 8.3 branch, per request from Tom.
This commit is contained in:
parent
881a97da86
commit
2193da28b1
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.68.2.12 2010/03/01 02:21:40 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.68.2.13 2010/03/03 00:32:49 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -100,7 +100,6 @@ static void *xml_palloc(size_t size);
|
|||||||
static void *xml_repalloc(void *ptr, size_t size);
|
static void *xml_repalloc(void *ptr, size_t size);
|
||||||
static void xml_pfree(void *ptr);
|
static void xml_pfree(void *ptr);
|
||||||
static char *xml_pstrdup(const char *string);
|
static char *xml_pstrdup(const char *string);
|
||||||
|
|
||||||
#endif /* USE_LIBXMLCONTEXT */
|
#endif /* USE_LIBXMLCONTEXT */
|
||||||
|
|
||||||
static void xml_init(void);
|
static void xml_init(void);
|
||||||
@ -1355,7 +1354,6 @@ xml_pstrdup(const char *string)
|
|||||||
{
|
{
|
||||||
return MemoryContextStrdup(LibxmlContext, string);
|
return MemoryContextStrdup(LibxmlContext, string);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* USE_LIBXMLCONTEXT */
|
#endif /* USE_LIBXMLCONTEXT */
|
||||||
|
|
||||||
|
|
||||||
@ -3431,13 +3429,13 @@ xpath(PG_FUNCTION_ARGS)
|
|||||||
|
|
||||||
if (doc == NULL || xmlDocGetRootElement(doc) == NULL)
|
if (doc == NULL || xmlDocGetRootElement(doc) == NULL)
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* In case we have a fragment rather than a well-formed XML document,
|
* In case we have a fragment rather than a well-formed XML
|
||||||
* which has a single root (XML well-formedness), we try again after
|
* document, which has a single root (XML well-formedness), we try
|
||||||
* transforming the xml by stripping away the XML prolog, if any, and
|
* again after transforming the xml by stripping away the XML
|
||||||
* wrapping the remainder in a dummy element (<x>...</x>),
|
* prolog, if any, and wrapping the remainder in a dummy element
|
||||||
* and later extending the XPath expression accordingly.
|
* (<x>...</x>), and later extending the XPath expression
|
||||||
|
* accordingly.
|
||||||
*/
|
*/
|
||||||
if (len >= 5 &&
|
if (len >= 5 &&
|
||||||
xmlStrncmp((xmlChar *) datastr, (xmlChar *) "<?xml", 5) == 0)
|
xmlStrncmp((xmlChar *) datastr, (xmlChar *) "<?xml", 5) == 0)
|
||||||
@ -3468,7 +3466,10 @@ xpath(PG_FUNCTION_ARGS)
|
|||||||
xml_ereport(ERROR, ERRCODE_INVALID_XML_DOCUMENT,
|
xml_ereport(ERROR, ERRCODE_INVALID_XML_DOCUMENT,
|
||||||
"could not parse XML data");
|
"could not parse XML data");
|
||||||
|
|
||||||
/* we already know xpath_len > 0 - see above , so this test is safe */
|
/*
|
||||||
|
* we already know xpath_len > 0 - see above , so this test is
|
||||||
|
* safe
|
||||||
|
*/
|
||||||
|
|
||||||
if (*VARDATA(xpath_expr_text) == '/')
|
if (*VARDATA(xpath_expr_text) == '/')
|
||||||
{
|
{
|
||||||
@ -3489,8 +3490,8 @@ xpath(PG_FUNCTION_ARGS)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* if we didn't need to mangle the XML, we don't need to mangle the
|
* if we didn't need to mangle the XML, we don't need to mangle
|
||||||
* xpath either.
|
* the xpath either.
|
||||||
*/
|
*/
|
||||||
memcpy(xpath_expr, VARDATA(xpath_expr_text), xpath_len);
|
memcpy(xpath_expr, VARDATA(xpath_expr_text), xpath_len);
|
||||||
xpath_expr[xpath_len] = '\0';
|
xpath_expr[xpath_len] = '\0';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user