Paul J. Lucas has proposed merging lp:~paul-lucas/zorba/bug-932374 into 
lp:zorba.

Commit message:
Now using \z instead of $ for ICU.

Requested reviews:
  Paul J. Lucas (paul-lucas)
Related bugs:
  Bug #932374 in Zorba: "FOTS fn:matches failing tests"
  https://bugs.launchpad.net/zorba/+bug/932374

For more details, see:
https://code.launchpad.net/~paul-lucas/zorba/bug-932374/+merge/126127

Now using \z instead of $ for ICU.
-- 
https://code.launchpad.net/~paul-lucas/zorba/bug-932374/+merge/126127
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/util/regex.cpp'
--- src/util/regex.cpp	2012-09-17 00:36:37 +0000
+++ src/util/regex.cpp	2012-09-24 23:22:36 +0000
@@ -93,6 +93,7 @@
                         char const *xq_flags ) {
   icu_flags_t const icu_flags = convert_xquery_flags( xq_flags );
   bool const i_flag = (icu_flags & UREGEX_CASE_INSENSITIVE) != 0;
+  bool const m_flag = (icu_flags & UREGEX_MULTILINE) != 0;
   bool const q_flag = (icu_flags & UREGEX_LITERAL) != 0;
   bool const x_flag = (icu_flags & UREGEX_COMMENTS) != 0;
 
@@ -235,6 +236,17 @@
         case '\\':
           got_backslash = true;
           continue;
+        case '$':
+          if ( q_flag )
+            *icu_re += '\\';
+          else if ( !m_flag ) {
+            zstring::const_iterator const temp = xq_c + 1;
+            if ( temp == xq_re.end() ) {
+              icu_re->append( "\\z" );
+              continue;
+            }
+          }
+          break;
         case '(':
           if ( q_flag )
             *icu_re += '\\';

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to