Chameleon

Chameleon Commit Details

Date:2015-09-19 22:02:12 (3 years 9 months ago)
Author:Evan Lojewski
Commit:2760
Parents: 2759
Message:Fix bug in xml parses where keys like <integer ID=_ would break. These were improperly treated as strings and duplicated. Subsequent <integer IDREF keys would also retrieve the incorrect value.
Changes:
M/trunk/i386/libsaio/xml.c

File differences

trunk/i386/libsaio/xml.c
3838
3939
4040
41
4142
4243
4344
......
6566
6667
6768
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
6890
6991
7092
......
7799
78100
79101
102
103
104
105
106
107
108
109
110
111
112
113
114
80115
81116
82117
......
517552
518553
519554
520
555
521556
522557
523558
......
540575
541576
542577
543
578
544579
545580
546581
#endif
string_ref *ref_strings = NULL;
string_ref *ref_integer = NULL;
/// TODO: remove below
static char *buffer_start = NULL;
ref_strings = new_ref;
}
void SaveRefInteger(int integer, int id)
{
//printf("Adding Ref Integer %d (%s)\n", id, integer);
string_ref *tmp = ref_integer;
while(tmp)
{
if(tmp->id == id)
{
tmp->string = (char*)integer;
return;
}
tmp = tmp->next;
}
string_ref *new_ref = malloc(sizeof(string_ref));
new_ref->string = (char*)integer;
new_ref->id = id;
new_ref->next = ref_integer;
ref_integer = new_ref;
}
char *GetRefString(int id)
{
string_ref *tmp = ref_strings;
return "Unknown";
}
int GetRefInteger(int id)
{
string_ref *tmp = ref_integer;
while(tmp)
{
if(tmp->id == id) return (int)tmp->string;
tmp = tmp->next;
}
//verbose("Unable to locate Ref String %d\n", id);
return 0;
}
struct Module {
struct Module *nextModule;
longwillLoad;
}
length = ParseTagInteger(buffer + pos, tag);
SaveRefString((*tag)->string, id);
SaveRefInteger((int)(*tag)->string, id);
}
else if(!strncmp(tagName + strlen(kXMLTagInteger " "), kXMLStringIDRef, strlen(kXMLStringIDRef)))
{
return -1;
}
}
int integer = (int)GetRefString(id);
int integer = GetRefInteger(id);
TagPtr tmpTag = NewTag();
if (tmpTag == 0)

Archive Download the corresponding diff file

Revision: 2760