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

Proposed by Daniel Turcanu
Status: Superseded
Proposed branch: lp:~danielturcanu/zorba/mytrunk
Merge into: lp:zorba
Diff against target: 176 lines (+38/-11)
13 files modified
ChangeLog (+2/-0)
src/diagnostics/dict_XX_cpp.xq (+1/-0)
src/diagnostics/pregenerated/dict_en.cpp (+1/-0)
src/runtime/strings/strings_impl.cpp (+1/-1)
src/util/utf8_util_base.h (+1/-2)
src/zorbatypes/URI.cpp (+19/-8)
src/zorbatypes/URI.h (+2/-0)
test/rbkt/ExpQueryResults/zorba/resolving/path_to_uri.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_a4.xml.res (+1/-0)
test/rbkt/Queries/zorba/resolving/path_to_uri.spec (+4/-0)
test/rbkt/Queries/zorba/resolving/path_to_uri.xq (+3/-0)
test/rbkt/Queries/zorba/resolving/test.xml (+1/-0)
test/rbkt/Queries/zorba/string/Regex/regex_a4.xq (+1/-0)
To merge this branch: bzr merge lp:~danielturcanu/zorba/mytrunk
Reviewer Review Type Date Requested Status
Matthias Brantner Needs Fixing
Review via email: mp+78110@code.launchpad.net

This proposal has been superseded by a proposal from 2011-10-05.

Commit message

Fixed fn:analyze-string and URI for Windows.
Added tests to prove the fixes.

To post a comment you must log in.
Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

Please open two bugs for this and link the bug numbers from the ChangeLog. Also, please describe (or mention the bugs) in the commit message. We already went back and forth with URI fixes plenty of times and it's very confusing if it's unclear which scenario your commit is supposed to fix.

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

See comment recently made.

review: Needs Fixing
lp:~danielturcanu/zorba/mytrunk updated
10472. By Daniel Turcanu

Update to trunk.
Update Changelog with reference to fixed bugs

10473. By Daniel Turcanu

Reverted changes in URI

10474. By Daniel Turcanu

Updated to trunk

10475. By Daniel Turcanu

Update to trunk

10476. By Daniel Turcanu

Update to trunk

10477. By Daniel Turcanu

Reverted change to http_client

10478. By Daniel Turcanu

Update to trunk

10479. By Daniel Turcanu

Deleted blank uri test

10480. By Daniel Turcanu

Update to trunk

10481. By Daniel Turcanu

Update to trunk

10482. By Daniel Turcanu

Update to trunk

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2011-10-04 18:22:59 +0000
3+++ ChangeLog 2011-10-05 13:13:27 +0000
4@@ -41,6 +41,8 @@
5 * Fixed bug #863730 (static delete-node* functions don't raise ZDDY0012)
6 * Implemented the probe-index-range-value for general indexes
7 * Fixed bug #867662 ("nullptr" warning)
8+ * Fixed bug #868329 (URI resolver fails on Windows with absolute paths)
9+ * Fixed bug #868325 (fn:analyze-string fails with some recursive subgroups)
10
11 version 2.0.1
12
13
14=== modified file 'src/diagnostics/dict_XX_cpp.xq'
15--- src/diagnostics/dict_XX_cpp.xq 2011-08-05 02:21:55 +0000
16+++ src/diagnostics/dict_XX_cpp.xq 2011-10-05 13:13:27 +0000
17@@ -64,6 +64,7 @@
18 return string-join(
19 ( util:copyright(),
20 '#include "stdafx.h"',
21+ '#include "zorba/config.h"',
22 '#include "diagnostics/dict_impl.h"',
23 '',
24 'namespace zorba {',
25
26=== modified file 'src/diagnostics/pregenerated/dict_en.cpp'
27--- src/diagnostics/pregenerated/dict_en.cpp 2011-10-04 05:28:07 +0000
28+++ src/diagnostics/pregenerated/dict_en.cpp 2011-10-05 13:13:27 +0000
29@@ -20,6 +20,7 @@
30 */
31
32 #include "stdafx.h"
33+#include "zorba/config.h"
34 #include "diagnostics/dict_impl.h"
35
36 namespace zorba {
37
38=== modified file 'src/runtime/strings/strings_impl.cpp'
39--- src/runtime/strings/strings_impl.cpp 2011-08-10 18:58:11 +0000
40+++ src/runtime/strings/strings_impl.cpp 2011-10-05 13:13:27 +0000
41@@ -1688,7 +1688,7 @@
42 GENV_ITEMFACTORY->createString(strid_item, zstrid);
43 store::Item_t id_attrib_item;
44 GENV_ITEMFACTORY->createAttributeNode(id_attrib_item, group_elem.getp(), nr_attrib_name, untyped_type_name, strid_item);
45- if(match_startg < 0)
46+ if((match_startg < 0) || (match_startg < match_endgood))
47 continue;
48 match_endgood = match_endg;
49 if((i+1)<nr_pattern_groups)
50
51=== modified file 'src/util/utf8_util_base.h'
52--- src/util/utf8_util_base.h 2011-07-17 20:05:49 +0000
53+++ src/util/utf8_util_base.h 2011-10-05 13:13:27 +0000
54@@ -148,8 +148,7 @@
55 * @return Returns the Unicode code-point of the next character.
56 */
57 template<class OctetIterator>
58-ZORBA_DLL_PUBLIC
59-unicode::code_point next_char( OctetIterator &i );
60+ZORBA_DLL_PUBLIC unicode::code_point next_char( OctetIterator &i );
61
62 /**
63 * Decodes the previous Unicode character.
64
65=== modified file 'src/zorbatypes/URI.cpp'
66--- src/zorbatypes/URI.cpp 2011-06-24 23:00:33 +0000
67+++ src/zorbatypes/URI.cpp 2011-10-05 13:13:27 +0000
68@@ -1191,7 +1191,16 @@
69 return is_set(Scheme) && !theScheme.empty();
70 }
71
72-
73+bool URI::is_absolute_path(zstring &thePath)
74+{
75+#ifndef WIN32
76+ return thePath[0] == '/';
77+#else
78+ return (thePath.length() > 2) &&
79+ ((thePath[1] == ':') ||
80+ ((thePath[1] == '%') && (thePath[2] == '3') && (thePath[3] == 'A')));
81+#endif
82+}
83
84 /*******************************************************************************
85
86@@ -1331,7 +1340,7 @@
87
88 // If the path component begins with a slash character ("/"), then
89 // the reference is an absolute-path and we skip to step 7.
90- if ( (is_set(Path)) && (thePath[0] =='/') )
91+ if ( is_set(Path) && is_absolute_path(thePath) )
92 {
93 invalidate_text();
94 return;
95@@ -1342,12 +1351,14 @@
96
97 if ( base_uri->is_set(Path) )
98 {
99- zstring::size_type last_slash = base_path.rfind("/");
100- if ( last_slash != zstring::npos )
101- path = base_path.substr(0, last_slash+1);
102-// else
103-// path = "/";
104-
105+ if(!is_absolute_path(thePath))
106+ {
107+ zstring::size_type last_slash = base_path.rfind("/");
108+ if ( last_slash != zstring::npos )
109+ path = base_path.substr(0, last_slash+1);
110+ // else
111+ // path = "/";
112+ }
113 }
114
115 // 6b - append the relative URI path
116
117=== modified file 'src/zorbatypes/URI.h'
118--- src/zorbatypes/URI.h 2011-06-14 17:26:33 +0000
119+++ src/zorbatypes/URI.h 2011-10-05 13:13:27 +0000
120@@ -190,6 +190,8 @@
121 void unset_state(uint32_t s) const { theState &= ~s; }
122
123 void invalidate_text() const;
124+
125+ bool is_absolute_path(zstring &thePath);
126 };
127
128
129
130=== added file 'test/rbkt/ExpQueryResults/zorba/resolving/path_to_uri.xml.res'
131--- test/rbkt/ExpQueryResults/zorba/resolving/path_to_uri.xml.res 1970-01-01 00:00:00 +0000
132+++ test/rbkt/ExpQueryResults/zorba/resolving/path_to_uri.xml.res 2011-10-05 13:13:27 +0000
133@@ -0,0 +1,1 @@
134+<a/>
135\ No newline at end of file
136
137=== added directory 'test/rbkt/ExpQueryResults/zorba/string/Regex'
138=== added file 'test/rbkt/ExpQueryResults/zorba/string/Regex/regex_a4.xml.res'
139--- test/rbkt/ExpQueryResults/zorba/string/Regex/regex_a4.xml.res 1970-01-01 00:00:00 +0000
140+++ test/rbkt/ExpQueryResults/zorba/string/Regex/regex_a4.xml.res 2011-10-05 13:13:27 +0000
141@@ -0,0 +1,1 @@
142+<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>
143\ No newline at end of file
144
145=== added file 'test/rbkt/Queries/zorba/resolving/path_to_uri.spec'
146--- test/rbkt/Queries/zorba/resolving/path_to_uri.spec 1970-01-01 00:00:00 +0000
147+++ test/rbkt/Queries/zorba/resolving/path_to_uri.spec 2011-10-05 13:13:27 +0000
148@@ -0,0 +1,4 @@
149+Args:
150+-x
151+input-context:=xs:string($RBKT_SRC_DIR/Queries/zorba/resolving/test.xml)
152+
153
154=== added file 'test/rbkt/Queries/zorba/resolving/path_to_uri.xq'
155--- test/rbkt/Queries/zorba/resolving/path_to_uri.xq 1970-01-01 00:00:00 +0000
156+++ test/rbkt/Queries/zorba/resolving/path_to_uri.xq 2011-10-05 13:13:27 +0000
157@@ -0,0 +1,3 @@
158+declare variable $input-context as xs:string external;
159+
160+fn:doc(fn:resolve-uri($input-context))
161\ No newline at end of file
162
163=== added file 'test/rbkt/Queries/zorba/resolving/test.xml'
164--- test/rbkt/Queries/zorba/resolving/test.xml 1970-01-01 00:00:00 +0000
165+++ test/rbkt/Queries/zorba/resolving/test.xml 2011-10-05 13:13:27 +0000
166@@ -0,0 +1,1 @@
167+<a/>
168\ No newline at end of file
169
170=== added directory 'test/rbkt/Queries/zorba/string/Regex'
171=== added file 'test/rbkt/Queries/zorba/string/Regex/regex_a4.xq'
172--- test/rbkt/Queries/zorba/string/Regex/regex_a4.xq 1970-01-01 00:00:00 +0000
173+++ test/rbkt/Queries/zorba/string/Regex/regex_a4.xq 2011-10-05 13:13:27 +0000
174@@ -0,0 +1,1 @@
175+fn:analyze-string("ac", "((a)|(c))+")
176\ No newline at end of file

Subscribers

People subscribed via source and target branches