Path: utzoo!telly!attcan!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!MTXINU.COM!kadmon!jason From: kadmon!jason@MTXINU.COM (Jason Venner) Newsgroups: gnu.g++.bug Subject: gsub problems with libg++ 1.32 Message-ID: <7542.604135472@kadmon> Date: 22 Feb 89 07:24:32 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 44 Given the input 'Hello There' the following program core dumps when printing out the damaged String tester. #include #include #include main( int argc, char** argv ) { char buf[2*1024]; Regex angle("<[^ \t>]+>"); Regex Re("[ \t]+$"); Regex White( "[ \t]+" ); String result; while( gets(buf) ){ String tester( buf ); printf( "tester is '%s'\n", (char*) tester ); if( tester.contains(White)>=0 ) { printf( "Match for '%s'\n", (char*) "WHITE" ); tester.gsub(White, "W"); printf( "'%s' -> '%s'\n", buf, (char*) tester ); cout << tester << '\n'; } tester = buf; if( tester.contains(angle)>=0 ) { printf( "Match for '%s'\n", (char*) "ANGLE" ); tester.gsub(angle, "X"); printf( "'%s' -> '%s'\n", buf, (char*) tester ); cout << tester << '\n'; } tester = buf; if( tester.contains(Re)>=0 ) { printf( "Match for '%s'\n", (char*) "END" ); tester.gsub(Re, "E" ); printf( "'%s' -> '%s'\n", buf, (char*) tester ); cout << tester << '\n'; } } exit( 0 ); }