mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
Christian Glahn found a small bug in the push parser. cleaned up and made
* parser.c: Christian Glahn found a small bug in the push parser. * xmlIO.c include/libxml/xmlIO.h: cleaned up and made xmlCheckFilename public Daniel
This commit is contained in:
15
xmlIO.c
15
xmlIO.c
@ -261,25 +261,22 @@ xmlCleanupOutputCallbacks(void)
|
||||
* returns 1. if stat fails, returns 0 (if calling
|
||||
* stat on the filename fails, it can't be right).
|
||||
* if stat succeeds and the file is a directory,
|
||||
* sets errno to EISDIR and returns 0. otherwise
|
||||
* returns 1.
|
||||
* returns 2. otherwise returns 1.
|
||||
*/
|
||||
|
||||
static int
|
||||
int
|
||||
xmlCheckFilename (const char *path)
|
||||
{
|
||||
#ifdef HAVE_STAT
|
||||
#ifdef S_ISDIR
|
||||
struct stat stat_buffer;
|
||||
|
||||
if (stat(path, &stat_buffer) == -1)
|
||||
return 0;
|
||||
|
||||
#ifdef S_ISDIR
|
||||
if (S_ISDIR(stat_buffer.st_mode)) {
|
||||
errno = EISDIR;
|
||||
return 0;
|
||||
return 2;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
return 1;
|
||||
@ -992,7 +989,7 @@ static void
|
||||
xmlFreeHTTPWriteCtxt( xmlIOHTTPWriteCtxtPtr ctxt )
|
||||
{
|
||||
if ( ctxt->uri != NULL )
|
||||
free( ctxt->uri );
|
||||
xmlFree( ctxt->uri );
|
||||
|
||||
if ( ctxt->doc_buff != NULL ) {
|
||||
|
||||
@ -1007,7 +1004,7 @@ xmlFreeHTTPWriteCtxt( xmlIOHTTPWriteCtxtPtr ctxt )
|
||||
}
|
||||
}
|
||||
|
||||
free( ctxt );
|
||||
xmlFree( ctxt );
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user