As a quick check, can you see if this fixes the copyURI issue for you?
--- a/utils/fox_m_utils_uri.F90
+++ b/utils/fox_m_utils_uri.F90
@@ -365,6 +365,7 @@ contains
p = checkNonOpaquePath(path, segments)
if (.not.p) then
p = checkOpaquePart(path)
+ if (p) allocate(segments(0))
endif
end function checkPath
As for the dumpCPtree thing - that's a debug call; it shouldn't have
been left in the release version, sorry about that!
Toby
On 14 Jan 2009, at 23:39, Shane Clauson wrote:
> Thank you people,
> Perhaps its a windows/ifort 10 issue.
> I'll attempt to produce a succinct demonstration of the issue when
> time permits.
> However, right now the hack makes the symptoms go away,
> (and arguably makes the URI code more robust) but there is a
> deadline on my project that won't go away, so the extra
> investigation will need to wait,
> apologies.
>
> Also on an unrelated issue, I found the dumping to stdout of a
> loaded DTD by
> parse_dtd_element was useful when first testing the dtd, but proved
> to be
> somewhat noisy for my particular application.
> To silence it, I made its inclusion optional via a preprocessor
> directive.
> In case this would be useful to others, I've included the relevant
> snippet below
> so you can consider it for the next release. No doubt there will be
> an established
> idiom for coding this sort of thing in FoX, but I am not familiar
> enough with the codebase
> to make that assessment.
>
> Cheers,
> Shane
>
>
> m_common_element.F90
> ...
> subroutine parse_dtd_element(contents, xv, stack, element, internal)
> ...
> if (associated(element)) then
> element%any = any
> element%empty = empty
> element%mixed = mixed
> element%model => vs_str_alloc(trim(strip_spaces(contents)))
> element%cp => top
> element%internal = internal
> #ifdef DEBUG
> call dumpCPtree(top)
> #endif
> else
> if (associated(top)) call destroyCPtree(top)
> endif
> return
>
>
>
> Toby White wrote:
>>
>> On 14 Jan 2009, at 09:54, Andrew Walker wrote:
>>
>>> Your case should not have a null pointer to segments, so I suspect
>>> something is going wrong before copyURI is called. Having said that,
>>> from my quick look at the code in parseURI it's not completely clear
>>> if segments is never allowed to be null. If it can be then your fix
>>> looks useful anyway. Perhaps Toby can comment on this?
>>>
>> segments should never be null. The initialization code ultimately
>> lives
>> in checkNonOpaquePath (which, ironically, is probably rather an
>> opaque
>> place for it to live.) where segments should be guaranteed to be
>> initialized,
>> albeit sometimes to a zero-length array.
>>
>> On quick inspection, I think their *may* be a bug when an opaque path
>> is used
>> in the URI, where segments will not be allocated correctly. This
>> should be
>> fixed, but it's an edge case, and I don't think it's causing the
>> issue
>> here.
>>
>> (from RFC 2396: 'URIs that do not make use of the slash "/" character
>> for separating hierarchical components are considered opaque by the
>> generic URI parser.')
>>
>> If parseURI ever generates a URI object with segments being null,
>> it's
>> a bug.
>>
>> Toby
>>
>>
>>
>>
>
>
> >
I've also had a chance to look at the windows absolute path issue, and
have one partial fix
that should be applied to the distribution. It would appear that for
ifort10/windows,
blanks at the unused end (if any) of the URIstring supplied to parseURI
will cause paths like
"/folderAtRoot/activity.xml" to fail.
A simple fix for this sort of path specifier on windows is to trim the
string supplied
to parseURI, as below.
-------------------------------------------------------------------------------
--- FoX/utils/fox_m_utils_uri.F90
***************
*** 385,393 ****
end function checkFragment
#endif
! function parseURI(URIstring) result(u)
! character(len=*), intent(in) :: URIstring
type(URI), pointer :: u
#ifndef DUMMYLIB
character, pointer, dimension(:) :: scheme, authority, &
userinfo, host, path, query, fragment
--- 385,394 ----
end function checkFragment
#endif
! function parseURI(inURIstring) result(u)
! character(len=*), intent(in) :: inURIstring
type(URI), pointer :: u
+ character(len=len_trim(inURIstring)) :: URIstring
#ifndef DUMMYLIB
character, pointer, dimension(:) :: scheme, authority, &
userinfo, host, path, query, fragment
***************
*** 398,403 ****
--- 399,405 ----
#endif
u => null()
+ URIstring = trim(inURIString)
#ifndef DUMMYLIB
scheme => null()
-------------------------------------------------------------------------------
This fix also has the benefit of being a little more efficient with the
storage used by the
"path" component of the uri.
I'll try next to see what can be done about resolving the issue of
windows paths containing
drive specifiers like "C:"
Regards,
Shane.
> <mailto:and...@diopside.local>>