[cvsnt] Bugfix for problem in info_trigger.cpp

Mike Henry MikeH at pixelworks.com
Sat Jul 9 01:28:01 BST 2005


I don't know what your process is for submitting a bug fix, but here it is.

PROBLEM:
If the loginfo file contains an ALL statement, the directory name will not be
sent to the script if a DEFAULT exist or a matching module name. The rep_flag
is initialized to false in the loginfo API, but only once before parsing of
the loginfo file is done. This value needs to be re-initialized before each
call to parse_info_line.

SOLUTION:
I added some code to the parse_info API in info_trigger.cpp. This is ok, but
I think the best solution would be to create a init API for each caller of
the parse_info function. Then it is called by parse_info_line before parsing
begins.

    if(all_line.size())
    {
        if(!acc.seek(all_pos,CFileAccess::seekBegin))
        {
            CServerIo::error("seek failed\n");
        }

        // *** START OF NEW CODE BLOCK ***
        // If we are processing the loginfo file, then we must make sure the login_info state is initialized
        // before handling the ALL case.
        if (spec_options == loginfo_options)
        {
            // Make sure the "rep_flag" is initialized to default value. If a match was found or the default case
            // handled, then the flag will be set and the directory name will not be automatically inserted.
        	login_info.rep_flag=false;
            CServerIo::trace(3,"Reset rep_flag");
        }
        // *** END OF NEW CODE BLOCK ***

        ret += parse_info_line(acc,all_line.c_str(),generic_options,spec_options,file,all_current_line);
    }

    acc.close();

    return ret;
}

Mike Henry
Principal Architect
Pixelworks, Inc.
8100 SW Nyberg Rd.
Tualatin OR 97062
503-454-1750x1612




More information about the cvsnt mailing list