Thread View: gnu.g++.bug
1 messages
1 total messages
Started by Jason Venner
Thu, 23 Feb 1989 08:04
fix for bug in Regex gsub in libg++ 1.32
Author: Jason Venner
Date: Thu, 23 Feb 1989 08:04
Date: Thu, 23 Feb 1989 08:04
49 lines
1545 bytes
1545 bytes
*** /viarag/gnu/libg++/src/String.cc Wed Jan 11 04:17:10 1989
--- String.cc Wed Feb 22 23:03:59 1989
***************
*** 576,591 ****
const char* s = rep->s;
StrRep* nrep = Sresize(0, 2 * sl); // guess size
! char* x = rep->s;
int si = 0;
int xi = 0;
int remaining = sl;
! int pos, pl;
while (remaining > 0)
{
! pos = pat.search(s, sl, pl, si);
if (pos < 0 || pl <= 0)
break;
else
--- 576,591 ----
const char* s = rep->s;
StrRep* nrep = Sresize(0, 2 * sl); // guess size
! char* x = nrep->s;
int si = 0;
int xi = 0;
int remaining = sl;
! int pos, pl = 0; // how long is a regular expression?
while (remaining > 0)
{
! pos = pat.search(s, sl, pl, si); // unlike string search, the pos returned here is absolute
if (pos < 0 || pl <= 0)
break;
else
***************
*** 596,601 ****
--- 596,602 ----
nrep = Sresize(nrep, mustfit);
x = nrep->s;
}
+ pos -= si;
ncopy(&(s[si]), &(x[xi]), pos);
ncopy(r, &(x[xi + pos]), rl);
si += pos + pl;
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads