← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~danielturcanu/zorba/mytrunk into lp:zorba

 

Daniel Turcanu has proposed merging lp:~danielturcanu/zorba/mytrunk into lp:zorba.

Requested reviews:
  Matthias Brantner (matthias-brantner)
  Chris Hillery (ceejatec)

For more details, see:
https://code.launchpad.net/~danielturcanu/zorba/mytrunk/+merge/78621

Removed changes for URI, left only changes for fn:analyze-string.
-- 
https://code.launchpad.net/~danielturcanu/zorba/mytrunk/+merge/78621
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2011-10-05 22:39:18 +0000
+++ ChangeLog	2011-10-07 15:18:36 +0000
@@ -41,6 +41,8 @@
   * Fixed bug #863730 (static delete-node* functions don't raise ZDDY0012)
   * Implemented the probe-index-range-value for general indexes
   * Fixed bug #867662 ("nullptr" warning)
+  * Fixed bug #868329 (URI resolver fails on Windows with absolute paths)
+  * Fixed bug #868325 (fn:analyze-string fails with some recursive subgroups)
 
 version 2.0.1
 

=== modified file 'src/diagnostics/dict_XX_cpp.xq'
--- src/diagnostics/dict_XX_cpp.xq	2011-08-05 02:21:55 +0000
+++ src/diagnostics/dict_XX_cpp.xq	2011-10-07 15:18:36 +0000
@@ -64,6 +64,7 @@
 return string-join(
   ( util:copyright(), 
     '#include "stdafx.h"',
+    '#include "zorba/config.h"',
     '#include "diagnostics/dict_impl.h"',
     '',
     'namespace zorba {',

=== modified file 'src/diagnostics/pregenerated/dict_en.cpp'
--- src/diagnostics/pregenerated/dict_en.cpp	2011-10-04 05:28:07 +0000
+++ src/diagnostics/pregenerated/dict_en.cpp	2011-10-07 15:18:36 +0000
@@ -20,6 +20,7 @@
   */
  
 #include "stdafx.h"
+#include "zorba/config.h"
 #include "diagnostics/dict_impl.h"
 
 namespace zorba {

=== modified file 'src/runtime/strings/strings_impl.cpp'
--- src/runtime/strings/strings_impl.cpp	2011-08-10 18:58:11 +0000
+++ src/runtime/strings/strings_impl.cpp	2011-10-07 15:18:36 +0000
@@ -1688,7 +1688,7 @@
     GENV_ITEMFACTORY->createString(strid_item, zstrid);
     store::Item_t id_attrib_item;
     GENV_ITEMFACTORY->createAttributeNode(id_attrib_item, group_elem.getp(), nr_attrib_name, untyped_type_name, strid_item);
-    if(match_startg < 0)
+    if((match_startg < 0) || (match_startg < match_endgood))
       continue;
     match_endgood = match_endg;
     if((i+1)<nr_pattern_groups)

=== modified file 'src/util/utf8_util_base.h'
--- src/util/utf8_util_base.h	2011-07-17 20:05:49 +0000
+++ src/util/utf8_util_base.h	2011-10-07 15:18:36 +0000
@@ -148,8 +148,7 @@
  * @return Returns the Unicode code-point of the next character.
  */
 template<class OctetIterator>
-ZORBA_DLL_PUBLIC
-unicode::code_point next_char( OctetIterator &i );
+ZORBA_DLL_PUBLIC unicode::code_point next_char( OctetIterator &i );
 
 /**
  * Decodes the previous Unicode character.

=== modified file 'src/zorbatypes/URI.cpp'
--- src/zorbatypes/URI.cpp	2011-06-24 23:00:33 +0000
+++ src/zorbatypes/URI.cpp	2011-10-07 15:18:36 +0000
@@ -1191,7 +1191,16 @@
   return is_set(Scheme) && !theScheme.empty();
 }
 
-
+bool URI::is_absolute_path(zstring &thePath)
+{
+#ifndef WIN32
+  return thePath[0] == '/';
+#else
+  return (thePath.length() > 2) && 
+          ((thePath[1] == ':') || 
+           ((thePath[1] == '%') && (thePath[2] == '3') && (thePath[3] == 'A')));
+#endif
+}
 
 /*******************************************************************************
 
@@ -1331,7 +1340,7 @@
 
   // If the path component begins with a slash character ("/"), then
   // the reference is an absolute-path and we skip to step 7.
-  if ( (is_set(Path)) && (thePath[0] =='/') ) 
+  if ( is_set(Path) && is_absolute_path(thePath) ) 
   {
      invalidate_text();
      return;
@@ -1342,12 +1351,14 @@
 
   if ( base_uri->is_set(Path) ) 
   {
-    zstring::size_type last_slash = base_path.rfind("/");
-    if ( last_slash != zstring::npos )
-      path = base_path.substr(0, last_slash+1);
-//  else
-//    path = "/";
-
+    if(!is_absolute_path(thePath))
+    {
+      zstring::size_type last_slash = base_path.rfind("/");
+      if ( last_slash != zstring::npos )
+        path = base_path.substr(0, last_slash+1);
+  //  else
+  //    path = "/";
+    }
   }
 
   // 6b - append the relative URI path

=== modified file 'src/zorbatypes/URI.h'
--- src/zorbatypes/URI.h	2011-06-14 17:26:33 +0000
+++ src/zorbatypes/URI.h	2011-10-07 15:18:36 +0000
@@ -190,6 +190,8 @@
   void unset_state(uint32_t s) const { theState &= ~s; }
 
   void invalidate_text() const;
+  
+  bool is_absolute_path(zstring &thePath);
 };
 
 

=== added file 'test/rbkt/ExpQueryResults/zorba/resolving/path_to_uri.xml.res'
--- test/rbkt/ExpQueryResults/zorba/resolving/path_to_uri.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/resolving/path_to_uri.xml.res	2011-10-07 15:18:36 +0000
@@ -0,0 +1,1 @@
+<a/>
\ No newline at end of file

=== added directory 'test/rbkt/ExpQueryResults/zorba/string/Regex'
=== added file 'test/rbkt/ExpQueryResults/zorba/string/Regex/regex_a4.xml.res'
--- test/rbkt/ExpQueryResults/zorba/string/Regex/regex_a4.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/string/Regex/regex_a4.xml.res	2011-10-07 15:18:36 +0000
@@ -0,0 +1,1 @@
+<fn:analyze-string-result xmlns:fn="http://www.w3.org/2005/xpath-functions";><fn:match>a<fn:group nr="1"><fn:group nr="2"/><fn:group nr="3">c</fn:group></fn:group></fn:match></fn:analyze-string-result>
\ No newline at end of file

=== added file 'test/rbkt/Queries/zorba/resolving/path_to_uri.spec'
--- test/rbkt/Queries/zorba/resolving/path_to_uri.spec	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/resolving/path_to_uri.spec	2011-10-07 15:18:36 +0000
@@ -0,0 +1,4 @@
+Args:
+-x 
+input-context:=xs:string($RBKT_SRC_DIR/Queries/zorba/resolving/test.xml)
+

=== added file 'test/rbkt/Queries/zorba/resolving/path_to_uri.xq'
--- test/rbkt/Queries/zorba/resolving/path_to_uri.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/resolving/path_to_uri.xq	2011-10-07 15:18:36 +0000
@@ -0,0 +1,3 @@
+declare variable $input-context as xs:string external;
+
+fn:doc(fn:resolve-uri($input-context))
\ No newline at end of file

=== added file 'test/rbkt/Queries/zorba/resolving/test.xml'
--- test/rbkt/Queries/zorba/resolving/test.xml	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/resolving/test.xml	2011-10-07 15:18:36 +0000
@@ -0,0 +1,1 @@
+<a/>
\ No newline at end of file

=== added directory 'test/rbkt/Queries/zorba/string/Regex'
=== added file 'test/rbkt/Queries/zorba/string/Regex/regex_a4.xq'
--- test/rbkt/Queries/zorba/string/Regex/regex_a4.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/string/Regex/regex_a4.xq	2011-10-07 15:18:36 +0000
@@ -0,0 +1,1 @@
+fn:analyze-string("ac", "((a)|(c))+")
\ No newline at end of file


Follow ups