meinproc/docbook can't handle paths with spaces ?

Ingo Klöcker kloecker at kde.org
Tue Dec 18 21:01:20 GMT 2007


On Tuesday 18 December 2007, Ingo Klöcker wrote:
> On Tuesday 18 December 2007, Oswald Buddenhagen wrote:
> > On Tue, Dec 18, 2007 at 05:54:58PM +0100, Alexander Neundorf wrote:
> > > On Tuesday 18 December 2007, Oswald Buddenhagen wrote:
> > > > have you tried url escaping? doesn't sound that unlikely, given
> > > > the context ...
> > >
> > > Good idea :-)
> > >
> > > This way ?
> > > ../../bin/meinproc4 --stylesheet
> > > /home/alex/src/kde4-svn/KDE%20dir/kdelibs/kdoctools/docbook/xsl/m
> > >an pages/docbook.xsl --check
> > > --srcdir=/home/alex/src/kde4-svn/KDE%20dir/kdelibs/kdoctools/
> > > /home/alex/src/kde4-svn/KDE\
> > > dir/kdelibs/doc/kbuildsycoca4/man-kbuildsycoca4.8.docbook
> >
> > yes.
> >
> > > Doesn't work either :-(
> >
> > bleh. try a proper file:/// url. if that doesn't work, hunt down
> > the libxml authors and do something nasty with them. :)
>
> Doesn't work either because xmllint splits at colon and spaces, so
> that a file:///.... url is split into "file" and "///....". :-/

FWIW, below you'll find the function that parses the result of 
getenv("SGML_CATALOG_FILES"). The code is pretty straightforward and 
it's obvious that nobody thought about spaces in a catalog's path.

=====

void
xmlLoadCatalogs(const char *pathss) {
    const char *cur;
    const char *paths;
    xmlChar *path;
#ifdef _WIN32
    int i, iLen;
#endif

    if (pathss == NULL)
        return;

    cur = pathss;
    while (*cur != 0) {
        while (xmlIsBlank_ch(*cur)) cur++;
        if (*cur != 0) {
            paths = cur;
            while ((*cur != 0) && (*cur != PATH_SEAPARATOR) && 
(!xmlIsBlank_ch(*cur)))
                cur++;
            path = xmlStrndup((const xmlChar *)paths, cur - paths);
#ifdef _WIN32
            iLen = strlen(path);
            for(i = 0; i < iLen; i++) {
                if(path[i] == '\\') {
                    path[i] = '/';
                }
            }
#endif
            if (path != NULL) {
                xmlLoadCatalog((const char *) path);
                xmlFree(path);
            }
        }
        while (*cur == PATH_SEAPARATOR)
            cur++;
    }
}

=====


Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071218/d921282a/attachment.sig>


More information about the kde-core-devel mailing list