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:
Dustin Mitchell 2000-01-13 20:42:35 +00:00
commit e1f87cf3b3

View file

@ -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));
memcpy(s->str+pos,data,len);
if (s->sp >= s->len) {
if (s->sp >= pos) {
int i;
s->sp = s->len;
#ifdef DOH_STRING_UPDATE_LINES
for (i = 0; i < len; i++) {
if (data[i] == '\n') s->line++;
@ -400,6 +400,7 @@ raw_insert(String *s, int pos, char *data, int len)
#endif
s->sp+=len;
}
s->len += len;
s->str[s->len] = 0;
}