Changed raw_insert to correctly update the file pointer (s->sp).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@88 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
b4e2b775fb
commit
9c38da024d
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));
|
||||
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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue