OLD | NEW |
---|---|
1 /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd | 1 /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd |
2 See the file COPYING for copying permission. | 2 See the file COPYING for copying permission. |
3 */ | 3 */ |
4 | 4 |
5 /* This file is included! */ | 5 /* This file is included! */ |
6 #ifdef XML_TOK_IMPL_C | 6 #ifdef XML_TOK_IMPL_C |
7 | 7 |
8 #ifndef IS_INVALID_CHAR | 8 #ifndef IS_INVALID_CHAR |
9 #define IS_INVALID_CHAR(enc, ptr, n) (0) | 9 #define IS_INVALID_CHAR(enc, ptr, n) (0) |
10 #endif | 10 #endif |
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
878 return XML_TOK_DATA_CHARS; | 878 return XML_TOK_DATA_CHARS; |
879 } | 879 } |
880 | 880 |
881 /* ptr points to character following "%" */ | 881 /* ptr points to character following "%" */ |
882 | 882 |
883 static int PTRCALL | 883 static int PTRCALL |
884 PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end, | 884 PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end, |
885 const char **nextTokPtr) | 885 const char **nextTokPtr) |
886 { | 886 { |
887 if (ptr == end) | 887 if (ptr == end) |
888 return -XML_TOK_PERCENT; | 888 return XML_TOK_PARTIAL; |
889 switch (BYTE_TYPE(enc, ptr)) { | 889 switch (BYTE_TYPE(enc, ptr)) { |
890 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) | 890 CHECK_NMSTRT_CASES(enc, ptr, end, nextTokPtr) |
891 case BT_S: case BT_LF: case BT_CR: case BT_PERCNT: | 891 case BT_S: case BT_LF: case BT_CR: case BT_PERCNT: |
892 *nextTokPtr = ptr; | 892 *nextTokPtr = ptr; |
893 return XML_TOK_PERCENT; | 893 return XML_TOK_PERCENT; |
894 default: | 894 default: |
895 *nextTokPtr = ptr; | 895 *nextTokPtr = ptr; |
896 return XML_TOK_INVALID; | 896 return XML_TOK_INVALID; |
897 } | 897 } |
898 while (ptr != end) { | 898 while (ptr != end) { |
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1737 } | 1737 } |
1738 } | 1738 } |
1739 } | 1739 } |
1740 | 1740 |
1741 static void PTRCALL | 1741 static void PTRCALL |
1742 PREFIX(updatePosition)(const ENCODING *enc, | 1742 PREFIX(updatePosition)(const ENCODING *enc, |
1743 const char *ptr, | 1743 const char *ptr, |
1744 const char *end, | 1744 const char *end, |
1745 POSITION *pos) | 1745 POSITION *pos) |
1746 { | 1746 { |
1747 while (ptr != end) { | 1747 while (ptr < end) { |
1748 switch (BYTE_TYPE(enc, ptr)) { | 1748 switch (BYTE_TYPE(enc, ptr)) { |
1749 #define LEAD_CASE(n) \ | 1749 #define LEAD_CASE(n) \ |
1750 case BT_LEAD ## n: \ | 1750 case BT_LEAD ## n: \ |
1751 if (end - ptr < n) { \ | 1751 if (end - ptr < n) { \ |
rlarocque
2013/12/17 21:35:36
It seems we added this early return statement to f
| |
1752 return; \ | 1752 return; \ |
1753 } \ | 1753 } \ |
1754 ptr += n; \ | 1754 ptr += n; \ |
1755 break; | 1755 break; |
1756 LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) | 1756 LEAD_CASE(2) LEAD_CASE(3) LEAD_CASE(4) |
1757 #undef LEAD_CASE | 1757 #undef LEAD_CASE |
1758 case BT_LF: | 1758 case BT_LF: |
1759 pos->columnNumber = (XML_Size)-1; | 1759 pos->columnNumber = (XML_Size)-1; |
1760 pos->lineNumber++; | 1760 pos->lineNumber++; |
1761 ptr += MINBPC(enc); | 1761 ptr += MINBPC(enc); |
1762 break; | 1762 break; |
(...skipping 14 matching lines...) Expand all Loading... | |
1777 | 1777 |
1778 #undef DO_LEAD_CASE | 1778 #undef DO_LEAD_CASE |
1779 #undef MULTIBYTE_CASES | 1779 #undef MULTIBYTE_CASES |
1780 #undef INVALID_CASES | 1780 #undef INVALID_CASES |
1781 #undef CHECK_NAME_CASE | 1781 #undef CHECK_NAME_CASE |
1782 #undef CHECK_NAME_CASES | 1782 #undef CHECK_NAME_CASES |
1783 #undef CHECK_NMSTRT_CASE | 1783 #undef CHECK_NMSTRT_CASE |
1784 #undef CHECK_NMSTRT_CASES | 1784 #undef CHECK_NMSTRT_CASES |
1785 | 1785 |
1786 #endif /* XML_TOK_IMPL_C */ | 1786 #endif /* XML_TOK_IMPL_C */ |
OLD | NEW |