Changed raw_insert to correctly update the file pointer (s->sp).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@88 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
ed01695d69
commit
e1f87cf3b3
1 changed files with 3 additions and 2 deletions
|
|
@ -390,9 +390,9 @@ raw_insert(String *s, int pos, char *data, int len)
|
||||||
}
|
}
|
||||||
memmove(s->str+pos+len, s->str+pos, (s->len - pos));
|
memmove(s->str+pos+len, s->str+pos, (s->len - pos));
|
||||||
memcpy(s->str+pos,data,len);
|
memcpy(s->str+pos,data,len);
|
||||||
if (s->sp >= s->len) {
|
if (s->sp >= pos) {
|
||||||
int i;
|
int i;
|
||||||
s->sp = s->len;
|
|
||||||
#ifdef DOH_STRING_UPDATE_LINES
|
#ifdef DOH_STRING_UPDATE_LINES
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
if (data[i] == '\n') s->line++;
|
if (data[i] == '\n') s->line++;
|
||||||
|
|
@ -400,6 +400,7 @@ raw_insert(String *s, int pos, char *data, int len)
|
||||||
#endif
|
#endif
|
||||||
s->sp+=len;
|
s->sp+=len;
|
||||||
}
|
}
|
||||||
|
|
||||||
s->len += len;
|
s->len += len;
|
||||||
s->str[s->len] = 0;
|
s->str[s->len] = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue