| 3949 | } |
| 3950 | |
| 3951 | static xmlChar ** |
| 3952 | parse_list(xmlChar *str) { |
| 3953 | xmlChar **buffer; |
| 3954 | xmlChar **out = NULL; |
| 3955 | int buffer_size = 0; |
| 3956 | int len; |
| 3957 | |
| 3958 | if(str == NULL) { |
| 3959 | return(NULL); |
| 3960 | } |
| 3961 | |
| 3962 | len = xmlStrlen(str); |
| 3963 | if((str[0] == '\'') && (str[len - 1] == '\'')) { |
| 3964 | str[len - 1] = '\0'; |
| 3965 | str++; |
| 3966 | } |
| 3967 | /* |
| 3968 | * allocate an translation buffer. |
| 3969 | */ |
| 3970 | buffer_size = 1000; |
| 3971 | buffer = (xmlChar **) xmlMalloc(buffer_size * sizeof(xmlChar*)); |
| 3972 | if (buffer == NULL) { |
| 3973 | perror("malloc failed"); |
| 3974 | return(NULL); |
| 3975 | } |
| 3976 | out = buffer; |
| 3977 | |
| 3978 | while(*str != '\0') { |
| 3979 | if (out - buffer > buffer_size - 10) { |
| 3980 | int indx = out - buffer; |
| 3981 | |
| 3982 | xxx_growBufferReentrant(); |
| 3983 | out = &buffer[indx]; |
| 3984 | } |
| 3985 | (*out++) = str; |
| 3986 | while(*str != ',' && *str != '\0') ++str; |
| 3987 | if(*str == ',') *(str++) = '\0'; |
| 3988 | } |
| 3989 | (*out) = NULL; |
| 3990 | return buffer; |
| 3991 | } |
| 3992 | |
| 3993 | static int |
| 3994 | c14nRunTest(const char* xml_filename, int with_comments, int mode, |
no test coverage detected