[TinyOWS-users] mapfile INCLUDE with relative path

Marc-André Trottier marcandre_trottier at hotmail.com
Mon Jul 11 09:55:31 EST 2011


i'm very very very beginner in C so my code is certainly ugly but here's what
I've done so far :

i done some change in mapfile.c on mapfile_build_path() :

static buffer * mapfile_build_path(ows * o, char * fpath)
{
        buffer * path;
        assert(fpath);
        char * config = "";
        char patate[45];
        char * pch;
        /* Path is absolute */
        if ((fpath[0] == '/') || (fpath[0] == '\\') || (strlen(fpath) &&
(fpath[1] == ':')))
                return buffer_from_str(fpath);

        /* Path is relative */
        path = buffer_init();

        config = (char *) o->config_file->buf;
        pch=strrchr(config,'/');
        strncpy(patate, config, pch-config+1);
        buffer_add_str(path,patate);
        buffer_add_str(path,fpath);

        return path;
}

i also delete a check on OWS_MAP_MAX_INCLUDE_DEPTH line 2469 of mapfile.c
because i did not found how increase the nesting level so if someone have a
clue
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/tinyows-users/attachments/20110711/890cb3f7/attachment.htm 


More information about the TinyOWS-users mailing list