Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libxml2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
external
libxml2
Commits
78637da0
Commit
78637da0
authored
Jul 31, 2003
by
William M. Brack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing bug 118559
parent
97e01886
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
82 additions
and
40 deletions
+82
-40
ChangeLog
ChangeLog
+14
-0
HTMLparser.c
HTMLparser.c
+6
-6
error.c
error.c
+0
-2
nanoftp.c
nanoftp.c
+1
-2
nanohttp.c
nanohttp.c
+9
-3
parser.c
parser.c
+1
-1
parserInternals.c
parserInternals.c
+1
-1
valid.c
valid.c
+1
-2
xinclude.c
xinclude.c
+1
-1
xmlIO.c
xmlIO.c
+7
-3
xmllint.c
xmllint.c
+25
-1
xpath.c
xpath.c
+16
-18
No files found.
ChangeLog
View file @
78637da0
Thu Jul 31 22:44:33 HKT 2003 William Brack <wbrack@mmm.com.hk>
Working on bug 118559
* error.c: deleted unused variable
* parserInternals.c: deleted unneeded 'const' qualifier
* parser.c: changed variable type for enum temp storage
* xmlIO.c: changed debugging var to be inside #ifdef
* valid.c: removed unused variable
* HTMLparser.c: removed some unneeded 'const' qualifiers
* xpath.c: added some type casts, removed some unused vars
* xinclude.c: added one type cast
* nanohttp.c: repositioned some #ifdef to avoid unused var
* nanoftp.c: removed unused var
Wed Jul 30 14:57:55 EDT 2003 Daniel Veillard <daniel@veillard.com>
* HTMLparser.c: applied a patch from William Brack about
...
...
HTMLparser.c
View file @
78637da0
...
...
@@ -962,7 +962,7 @@ htmlTagLookup(const xmlChar *tag) {
for
(
i
=
0
;
i
<
(
sizeof
(
html40ElementTable
)
/
sizeof
(
html40ElementTable
[
0
]));
i
++
)
{
if
(
!
xmlStrcasecmp
(
tag
,
BAD_CAST
html40ElementTable
[
i
].
name
))
return
((
const
htmlElemDescPtr
)
(
const
htmlElemDescPtr
)
(
const
htmlElemDescPtr
)
(
const
htmlElemDescPtr
)
(
const
htmlElemDescPtr
)
(
const
htmlElemDescPtr
)
(
const
htmlElemDescPtr
)
(
const
htmlElemDescPtr
)
(
const
htmlElemDescPtr
)
&
html40ElementTable
[
i
]);
return
((
htmlElemDescPtr
)
&
html40ElementTable
[
i
]);
}
return
(
NULL
);
}
...
...
@@ -1688,7 +1688,7 @@ htmlEntityLookup(const xmlChar *name) {
#ifdef DEBUG
xmlGenericError
(
xmlGenericErrorContext
,
"Found entity %s
\n
"
,
name
);
#endif
return
((
const
htmlEntityDescPtr
)
&
html40EntitiesTable
[
i
]);
return
((
htmlEntityDescPtr
)
&
html40EntitiesTable
[
i
]);
}
}
return
(
NULL
);
...
...
@@ -1719,7 +1719,7 @@ htmlEntityValueLookup(unsigned int value) {
#ifdef DEBUG
xmlGenericError
(
xmlGenericErrorContext
,
"Found entity %s
\n
"
,
html40EntitiesTable
[
i
].
name
);
#endif
return
((
const
htmlEntityDescPtr
)
&
html40EntitiesTable
[
i
]);
return
((
htmlEntityDescPtr
)
&
html40EntitiesTable
[
i
]);
}
#ifdef DEBUG
if
(
lv
>
html40EntitiesTable
[
i
].
value
)
{
...
...
@@ -4317,7 +4317,7 @@ htmlCreateDocParserCtxt(xmlChar *cur, const char *encoding ATTRIBUTE_UNUSED) {
* @first: the first char to lookup
* @next: the next char to lookup or zero
* @third: the next char to lookup or zero
* @
is
comment: flag to force checking inside comments
* @comment: flag to force checking inside comments
*
* Try to find if a sequence (first, next, third) or just (first next) or
* (first) is available in the input stream.
...
...
@@ -4331,7 +4331,7 @@ htmlCreateDocParserCtxt(xmlChar *cur, const char *encoding ATTRIBUTE_UNUSED) {
*/
static
int
htmlParseLookupSequence
(
htmlParserCtxtPtr
ctxt
,
xmlChar
first
,
xmlChar
next
,
xmlChar
third
,
int
is
comment
)
{
xmlChar
next
,
xmlChar
third
,
int
comment
)
{
int
base
,
len
;
htmlParserInputPtr
in
;
const
xmlChar
*
buf
;
...
...
@@ -4354,7 +4354,7 @@ htmlParseLookupSequence(htmlParserCtxtPtr ctxt, xmlChar first,
if
(
third
)
len
-=
2
;
else
if
(
next
)
len
--
;
for
(;
base
<
len
;
base
++
)
{
if
(
!
incomment
&&
(
base
+
4
<
len
)
&&
!
is
comment
)
{
if
(
!
incomment
&&
(
base
+
4
<
len
)
&&
!
comment
)
{
if
((
buf
[
base
]
==
'<'
)
&&
(
buf
[
base
+
1
]
==
'!'
)
&&
(
buf
[
base
+
2
]
==
'-'
)
&&
(
buf
[
base
+
3
]
==
'-'
))
{
incomment
=
1
;
...
...
error.c
View file @
78637da0
...
...
@@ -350,7 +350,6 @@ xmlParserValidityError(void *ctx, const char *msg, ...)
char
*
str
;
int
len
=
xmlStrlen
((
const
xmlChar
*
)
msg
);
static
int
had_info
=
0
;
int
need_context
=
0
;
if
((
len
>
1
)
&&
(
msg
[
len
-
2
]
!=
':'
))
{
if
(
ctxt
!=
NULL
)
{
...
...
@@ -363,7 +362,6 @@ xmlParserValidityError(void *ctx, const char *msg, ...)
}
}
xmlGenericError
(
xmlGenericErrorContext
,
"validity error: "
);
need_context
=
1
;
had_info
=
0
;
}
else
{
had_info
=
1
;
...
...
nanoftp.c
View file @
78637da0
...
...
@@ -978,14 +978,13 @@ xmlNanoFTPQuit(void *ctx) {
xmlNanoFTPCtxtPtr
ctxt
=
(
xmlNanoFTPCtxtPtr
)
ctx
;
char
buf
[
200
];
int
len
;
int
res
;
snprintf
(
buf
,
sizeof
(
buf
),
"QUIT
\r\n
"
);
len
=
strlen
(
buf
);
#ifdef DEBUG_FTP
xmlGenericError
(
xmlGenericErrorContext
,
"%s"
,
buf
);
/* Just to be consistent, even though we know it can't have a % in it */
#endif
res
=
send
(
ctxt
->
controlFd
,
buf
,
len
,
0
);
send
(
ctxt
->
controlFd
,
buf
,
len
,
0
);
return
(
0
);
}
...
...
nanohttp.c
View file @
78637da0
...
...
@@ -1214,9 +1214,11 @@ xmlNanoHTTPMethodRedir(const char *URL, const char *method, const char *input,
char
*
bp
,
*
p
;
int
blen
,
ret
;
int
head
;
int
xmt_bytes
;
int
nbRedirects
=
0
;
char
*
redirURL
=
NULL
;
#ifdef DEBUG_HTTP
int
xmt_bytes
;
#endif
if
(
URL
==
NULL
)
return
(
NULL
);
if
(
method
==
NULL
)
method
=
"GET"
;
...
...
@@ -1328,26 +1330,30 @@ retry:
ctxt
->
outptr
=
ctxt
->
out
=
bp
;
ctxt
->
state
=
XML_NANO_HTTP_WRITE
;
blen
=
strlen
(
ctxt
->
out
);
xmt_bytes
=
xmlNanoHTTPSend
(
ctxt
,
ctxt
->
out
,
blen
);
#ifdef DEBUG_HTTP
xmt_bytes
=
xmlNanoHTTPSend
(
ctxt
,
ctxt
->
out
,
blen
);
if
(
xmt_bytes
!=
blen
)
xmlGenericError
(
xmlGenericErrorContext
,
"xmlNanoHTTPMethodRedir: Only %d of %d %s %s
\n
"
,
xmt_bytes
,
blen
,
"bytes of HTTP headers sent to host"
,
ctxt
->
hostname
);
#else
xmlNanoHTTPSend
(
ctxt
,
ctxt
->
out
,
blen
);
#endif
if
(
input
!=
NULL
)
{
#ifdef DEBUG_HTTP
xmt_bytes
=
xmlNanoHTTPSend
(
ctxt
,
input
,
ilen
);
#ifdef DEBUG_HTTP
if
(
xmt_bytes
!=
ilen
)
xmlGenericError
(
xmlGenericErrorContext
,
"xmlNanoHTTPMethodRedir: Only %d of %d %s %s
\n
"
,
xmt_bytes
,
ilen
,
"bytes of HTTP content sent to host"
,
ctxt
->
hostname
);
#else
xmlNanoHTTPSend
(
ctxt
,
input
,
ilen
);
#endif
}
...
...
parser.c
View file @
78637da0
...
...
@@ -5111,7 +5111,7 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
}
else
if
((
RAW
==
'I'
)
&&
(
NXT
(
1
)
==
'G'
)
&&
(
NXT
(
2
)
==
'N'
)
&&
(
NXT
(
3
)
==
'O'
)
&&
(
NXT
(
4
)
==
'R'
)
&&
(
NXT
(
5
)
==
'E'
))
{
int
state
;
int
instate
;
xmlParserInputState
instate
;
int
depth
=
0
;
SKIP
(
6
);
...
...
parserInternals.c
View file @
78637da0
...
...
@@ -2530,7 +2530,7 @@ xmlParserAddNodeInfo(xmlParserCtxtPtr ctxt,
unsigned
long
pos
;
/* Find pos and check to see if node is already in the sequence */
pos
=
xmlParserFindNodeInfoIndex
(
&
ctxt
->
node_seq
,
(
const
xmlNodePtr
)
pos
=
xmlParserFindNodeInfoIndex
(
&
ctxt
->
node_seq
,
(
xmlNodePtr
)
info
->
node
);
if
(
pos
<
ctxt
->
node_seq
.
length
&&
ctxt
->
node_seq
.
buffer
[
pos
].
node
==
info
->
node
)
{
...
...
valid.c
View file @
78637da0
...
...
@@ -624,7 +624,6 @@ xmlValidBuildAContentModel(xmlElementContentPtr content,
*/
int
xmlValidBuildContentModel
(
xmlValidCtxtPtr
ctxt
,
xmlElementPtr
elem
)
{
xmlAutomataStatePtr
start
;
if
((
ctxt
==
NULL
)
||
(
elem
==
NULL
))
return
(
0
);
...
...
@@ -647,7 +646,7 @@ xmlValidBuildContentModel(xmlValidCtxtPtr ctxt, xmlElementPtr elem) {
elem
->
name
);
return
(
0
);
}
start
=
ctxt
->
state
=
xmlAutomataGetInitState
(
ctxt
->
am
);
ctxt
->
state
=
xmlAutomataGetInitState
(
ctxt
->
am
);
xmlValidBuildAContentModel
(
elem
->
content
,
ctxt
,
elem
->
name
);
xmlAutomataSetFinalState
(
ctxt
->
am
,
ctxt
->
state
);
elem
->
contModel
=
xmlAutomataCompile
(
ctxt
->
am
);
...
...
xinclude.c
View file @
78637da0
...
...
@@ -1436,7 +1436,7 @@ xmlXIncludeLoadTxt(xmlXIncludeCtxtPtr ctxt, const xmlChar *url, int nr) {
xmlChar
*
URL
;
int
i
;
xmlChar
*
encoding
=
NULL
;
xmlCharEncoding
enc
=
0
;
xmlCharEncoding
enc
=
(
xmlCharEncoding
)
0
;
/*
* Check the URL and remove any fragment identifier
...
...
xmlIO.c
View file @
78637da0
...
...
@@ -720,20 +720,24 @@ append_reverse_ulong( xmlZMemBuff * buff, unsigned long data ) {
*/
static
void
xmlFreeZMemBuff
(
xmlZMemBuffPtr
buff
)
{
#ifdef DEBUG_HTTP
int
z_err
;
#endif
if
(
buff
==
NULL
)
return
;
xmlFree
(
buff
->
zbuff
);
z_err
=
deflateEnd
(
&
buff
->
zctrl
);
#ifdef DEBUG_HTTP
z_err
=
deflateEnd
(
&
buff
->
zctrl
);
if
(
z_err
!=
Z_OK
)
xmlGenericError
(
xmlGenericErrorContext
,
"xmlFreeZMemBuff: Error releasing zlib context: %d
\n
"
,
z_err
);
#endif
#else
deflateEnd
(
&
buff
->
zctrl
);
#endif;
xmlFree
(
buff
);
return
;
...
...
xmllint.c
View file @
78637da0
...
...
@@ -145,7 +145,6 @@ static int stream = 0;
static
int
chkregister
=
0
;
static
const
char
*
output
=
NULL
;
/*
* Internal timing routines to remove the necessity to have unix-specific
* function calls
...
...
@@ -755,6 +754,31 @@ static void parseAndPrintFile(char *filename) {
}
#endif
#ifdef LIBXML_HTML_ENABLED
else
if
((
html
)
&&
(
push
))
{
FILE
*
f
;
f
=
fopen
(
filename
,
"r"
);
if
(
f
!=
NULL
)
{
int
res
,
size
=
3
;
char
chars
[
4096
];
htmlParserCtxtPtr
ctxt
;
/* if (repeat) */
size
=
4096
;
res
=
fread
(
chars
,
1
,
4
,
f
);
if
(
res
>
0
)
{
ctxt
=
htmlCreatePushParserCtxt
(
NULL
,
NULL
,
chars
,
res
,
filename
,
0
);
while
((
res
=
fread
(
chars
,
1
,
size
,
f
))
>
0
)
{
htmlParseChunk
(
ctxt
,
chars
,
res
,
0
);
}
htmlParseChunk
(
ctxt
,
chars
,
0
,
1
);
doc
=
ctxt
->
myDoc
;
htmlFreeParserCtxt
(
ctxt
);
}
fclose
(
f
);
}
}
else
if
(
html
)
{
doc
=
htmlParseFile
(
filename
,
NULL
);
}
...
...
xpath.c
View file @
78637da0
...
...
@@ -738,9 +738,9 @@ xmlXPathDebugDumpStepOp(FILE *output, xmlXPathCompExprPtr comp,
case
XPATH_OP_SORT
:
fprintf
(
output
,
"SORT"
);
break
;
case
XPATH_OP_COLLECT
:
{
xmlXPathAxisVal
axis
=
op
->
value
;
xmlXPathTestVal
test
=
op
->
value2
;
xmlXPathTypeVal
type
=
op
->
value3
;
xmlXPathAxisVal
axis
=
(
xmlXPathAxisVal
)
op
->
value
;
xmlXPathTestVal
test
=
(
xmlXPathTestVal
)
op
->
value2
;
xmlXPathTypeVal
type
=
(
xmlXPathTypeVal
)
op
->
value3
;
const
xmlChar
*
prefix
=
op
->
value4
;
const
xmlChar
*
name
=
op
->
value5
;
...
...
@@ -1945,7 +1945,7 @@ xmlXPathNodeSetMerge(xmlNodeSetPtr val1, xmlNodeSetPtr val2) {
*/
static
xmlNodeSetPtr
xmlXPathNodeSetMergeUnique
(
xmlNodeSetPtr
val1
,
xmlNodeSetPtr
val2
)
{
int
i
,
initNr
;
int
i
;
if
(
val2
==
NULL
)
return
(
val1
);
if
(
val1
==
NULL
)
{
...
...
@@ -1953,7 +1953,6 @@ xmlXPathNodeSetMergeUnique(xmlNodeSetPtr val1, xmlNodeSetPtr val2) {
}
/* @@ with_ns to check wether namespace nodes should be looked at @@ */
initNr
=
val1
->
nodeNr
;
for
(
i
=
0
;
i
<
val2
->
nodeNr
;
i
++
)
{
/*
...
...
@@ -7937,7 +7936,6 @@ xmlXPathCompPathExpr(xmlXPathParserContextPtr ctxt) {
xmlFree
(
name
);
}
else
if
(
name
!=
NULL
)
{
int
len
=
xmlStrlen
(
name
);
int
blank
=
0
;
while
(
NXT
(
len
)
!=
0
)
{
...
...
@@ -7950,8 +7948,8 @@ xmlXPathCompPathExpr(xmlXPathParserContextPtr ctxt) {
lc
=
1
;
break
;
}
else
if
(
IS_BLANK
(
NXT
(
len
)))
{
/*
skip to next
*/
blank
=
1
;
/*
ignore blanks
*/
;
}
else
if
(
NXT
(
len
)
==
':'
)
{
#ifdef DEBUG_STEP
xmlGenericError
(
xmlGenericErrorContext
,
...
...
@@ -8377,8 +8375,8 @@ xmlXPathCompNodeTest(xmlXPathParserContextPtr ctxt, xmlXPathTestVal *test,
STRANGE
;
return
(
NULL
);
}
*
type
=
0
;
*
test
=
0
;
*
type
=
(
xmlXPathTypeVal
)
0
;
*
test
=
(
xmlXPathTestVal
)
0
;
*
prefix
=
NULL
;
SKIP_BLANKS
;
...
...
@@ -8504,7 +8502,7 @@ xmlXPathCompNodeTest(xmlXPathParserContextPtr ctxt, xmlXPathTestVal *test,
*/
static
xmlXPathAxisVal
xmlXPathIsAxisName
(
const
xmlChar
*
name
)
{
xmlXPathAxisVal
ret
=
0
;
xmlXPathAxisVal
ret
=
(
xmlXPathAxisVal
)
0
;
switch
(
name
[
0
])
{
case
'a'
:
if
(
xmlStrEqual
(
name
,
BAD_CAST
"ancestor"
))
...
...
@@ -8602,7 +8600,7 @@ xmlXPathCompStep(xmlXPathParserContextPtr ctxt) {
xmlChar
*
name
=
NULL
;
const
xmlChar
*
prefix
=
NULL
;
xmlXPathTestVal
test
;
xmlXPathAxisVal
axis
=
0
;
xmlXPathAxisVal
axis
=
(
xmlXPathAxisVal
)
0
;
xmlXPathTypeVal
type
;
int
op1
;
...
...
@@ -8832,9 +8830,9 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
xmlXPathStepOpPtr
op
,
xmlNodePtr
*
first
,
xmlNodePtr
*
last
)
{
xmlXPathAxisVal
axis
=
op
->
value
;
xmlXPathTestVal
test
=
op
->
value2
;
xmlXPathTypeVal
type
=
op
->
value3
;
xmlXPathAxisVal
axis
=
(
xmlXPathAxisVal
)
op
->
value
;
xmlXPathTestVal
test
=
(
xmlXPathTestVal
)
op
->
value2
;
xmlXPathTypeVal
type
=
(
xmlXPathTypeVal
)
op
->
value3
;
const
xmlChar
*
prefix
=
op
->
value4
;
const
xmlChar
*
name
=
op
->
value5
;
const
xmlChar
*
URI
=
NULL
;
...
...
@@ -9253,9 +9251,9 @@ xmlXPathNodeCollectAndTestNth(xmlXPathParserContextPtr ctxt,
xmlXPathStepOpPtr
op
,
int
indx
,
xmlNodePtr
*
first
,
xmlNodePtr
*
last
)
{
xmlXPathAxisVal
axis
=
op
->
value
;
xmlXPathTestVal
test
=
op
->
value2
;
xmlXPathTypeVal
type
=
op
->
value3
;
xmlXPathAxisVal
axis
=
(
xmlXPathAxisVal
)
op
->
value
;
xmlXPathTestVal
test
=
(
xmlXPathTestVal
)
op
->
value2
;
xmlXPathTypeVal
type
=
(
xmlXPathTypeVal
)
op
->
value3
;
const
xmlChar
*
prefix
=
op
->
value4
;
const
xmlChar
*
name
=
op
->
value5
;
const
xmlChar
*
URI
=
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment