Ticket #2521: patch

File patch, 1.3 KB (added by Brad Spencer <spencer@…>, 14 years ago)
  • boost/date_time/date_parsing.hpp

    old new  
    7878     * arrays is from 0 to 'limit'. The index of the match is returned.
    7979     * Ex. "Jan" returns 0, "Dec" returns 11, "Tue" returns 2.
    8080     * 'limit' can be sent in with: greg_month::max(),
    81      * greg_weekday::max() or date_time::NumSpecialValues */
     81     * greg_weekday::max() or (date_time::NumSpecialValues - 1) */
    8282    template<class charT>
    8383    short find_match(const charT* const* short_names,
    8484                     const charT* const* long_names,
  • libs/date_time/src/gregorian/greg_month.cpp

    old new  
    7373  special_values special_value_from_string(const std::string& s) {
    7474    short i = date_time::find_match(special_value_names,
    7575                                    special_value_names,
    76                                     date_time::NumSpecialValues,
     76                                    date_time::NumSpecialValues - 1,
    7777                                    s);
    78     if(i > date_time::NumSpecialValues) { // match not found
     78    if(i > date_time::NumSpecialValues - 1) { // match not found
    7979      return not_special;
    8080    }
    8181    else {