|
From: Andre R. <and...@us...> - 2006-02-18 19:41:14
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11534/Common/source Modified Files: langregexp.c Log Message: Fixed bug in re.replace verb: named groups were consistently replaced with the whole match string instead of just the matched group. Index: langregexp.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langregexp.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** langregexp.c 8 Feb 2006 21:23:55 -0000 1.10 --- langregexp.c 18 Feb 2006 19:40:59 -0000 1.11 *************** *** 1366,1369 **** --- 1366,1375 ---- static boolean replscancompilenamed (int ix, int len, const char *cptr, int clen, bigstring bserror, void *refcon) { + /* + 2006-02-18 aradke: actually write the group index ref instead of just nil. + fixes bug in re.replace verb where any matched named groups would consistently + be replaced with the complete match string instead of just the matched group. + */ + tyreplscancompileinfo *info = (tyreplscancompileinfo *) refcon; int ref; *************** *** 1379,1383 **** } ! return (writehandlestreamreplpart (&(info->s), REGEXP_NAMED, ix, len, 0)); } /*replscancompilenamed*/ --- 1385,1389 ---- } ! return (writehandlestreamreplpart (&(info->s), REGEXP_NAMED, ix, len, ref)); } /*replscancompilenamed*/ |