Re: [xml] [PATCH] support long path names on WNT

Hash: SHA1

On 22.08.2012 21:14, Michael Stahl wrote:
hi all,

so we've got this patch to libxml2 2.7.6 in the LibreOffice code
base, inherited from OOo.  it fixes a definite problem, which is
that Windows has a rather low maximum path length restriction, and
there is a special trick on NT whereby path names can be prefixed
with "\\?\", in which case the maximum length is 32k, which ought
to be sufficient even for bloated office suites :)

i'll attach the patch to the xmlCanonicPath function.  note that i 
didn't write this and am by no means an expert on either
Microsoftean platforms or libxml so maybe it's not the best way to
do it.  well, the strlen call in there looks superfluous to me.
1) A stat() implementation that works with long paths (by wrapping W32
API calls that work with long paths) is definitely needed.
Stat-related part of the patch you've sent looks like a hack to me
(though it might work for the particular issue you have, and it
certainly won't make things worse). Maybe not just stat(), but other
functions. That's something that should be moved to an utility
library, or to one of the mingw projects ( or mingw-w64).

2) xmlCanonicPath() part of the patch is not something i can comment
upon; however, the comment in the code claims that canonicization is
intended to make the path URIable. \\?\ paths certainly are not usable
in URIs, AFAIU (CMIIAW), so this might have unpleasant consequences in
some codepaths. I'll leave that up to libxml experts to verify.

Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Mozilla -


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]