apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Friedrich Dominicus <fr...@q-software-solutions.de>
Subject Could this be a bug in file_io\win32\dir.c ?
Date Thu, 10 Jul 2008 14:31:52 GMT
#if APR_HAS_ANSI_FS
    ELSE_WIN_OS_IS_ANSI
    {
        /* This code path is always be invoked by apr_dir_open or 
         * apr_dir_rewind, so return without filling out the finfo.
         */
        if (thedir->dirhand == INVALID_HANDLE_VALUE) {
            /* '/' terminated, so add the '*' and pop it when we finish */
            char *eop = strchr(thedir->dirname, '\0');
            eop[0] = '*';
            eop[1] = '\0';
            thedir->dirhand = FindFirstFileA(thedir->dirname, 
                                             thedir->n.entry);
            eop[0] = '\0';
            if (thedir->dirhand == INVALID_HANDLE_VALUE) {
                return apr_get_os_error();
            }
            thedir->bof = 1;
            return APR_SUCCESS;
        }
        else if (thedir->bof) {
            /* Noop - we already called FindFirstFileW from
             * either apr_dir_open or apr_dir_rewind ... use
             * that first record.
             */
            thedir->bof = 0; 
        }
        else if (!FindNextFile(thedir->dirhand, thedir->n.entry)) {
            return apr_get_os_error();
        }
        while (thedir->rootlen &&
               thedir->rootlen + strlen(thedir->n.entry->cFileName) >= MAX_PATH)
        {
            if (!FindNextFileW(thedir->dirhand, thedir->w.entry)) {
                                                        ^ shouldn't
that be n?
                return apr_get_os_error();


Regards
Friedrich

Mime
View raw message