|
From: Seth D. <set...@us...> - 2004-12-12 12:53:31
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3572 Modified Files: langregexp.c Log Message: regexpscanreplacement() now always treats double backslashes as escaped backslashes, so two become one. Removed all the extra commentary. Index: langregexp.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/langregexp.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** langregexp.c 12 Dec 2004 03:29:51 -0000 1.7 --- langregexp.c 12 Dec 2004 12:53:18 -0000 1.8 *************** *** 1523,1542 **** - /* - 12/11/2004 smd: - regexpscanreplacement() should be converting double backslashes - to single backslashes, but isn't. In the replacement pattern, - double backslashes should be collapsed to single backslashes. - - This line: - msg( re.replace( re.compile( "(a)(b)" ), "\\1\\\\\\2", "ab" ) ) - - should display "a\b" but is instead showing "a\\b". There's no way - to "insert" a single (or any odd number) of backslashes to the result. - I've fixed it, but Andre is worried that it could cause breakage. - To make it work, uncomment the following line. - */ - /*#define REGEX_COMPACT_BACKSLASHES 1*/ - static boolean regexpscanreplacement (const char *pstart, long len, bigstring bserror, tyreplscanliteralcallback literalfunc, --- 1523,1526 ---- *************** *** 1630,1634 **** } } - #ifdef REGEX_COMPACT_BACKSLASHES else if (*p1 == '\\') { /* 2004/12/11 smd: double backslashes should be collapsed into singles */ --- 1614,1617 ---- *************** *** 1637,1645 **** return (false); ! p = plast = p1 + 1; continue; /*avoid incrementation of p*/ } - #endif else if (isdigit (*p1)) { --- 1620,1627 ---- return (false); ! p = plast = ++p1; continue; /*avoid incrementation of p*/ } else if (isdigit (*p1)) { |