Ticket #6304: boost.date_time.parsing.patch

File boost.date_time.parsing.patch, 2.1 KB (added by Thomas.Lemm@…, 11 years ago)

patches parsing of date_time s with facets

  • include/boost-1_48/boost/date_time/format_date_parser.hpp

    diff -Naur boost/include/boost-1_48/boost/date_time/format_date_parser.hpp boost.patched/include/boost-1_48/boost/date_time/format_date_parser.hpp
    old new  
    6060    else {
    6161      mr.cache += (*itr);
    6262    }
    63     itr++;
    64     j++;
     63    ++itr;
     64    ++j;
    6565  }
    6666  int_type i = -1;
    6767  // mr.cache will hold leading zeros. size() tells us when input is too short.
     
    711711        itr++; //advance past format specifier
    712712      }
    713713      else {  //skip past chars in format and in buffer
    714         itr++;
     714        ++itr;
    715715        if (use_current_char) {
    716716          use_current_char = false;
    717717          current_char = *sitr;
    718718        }
    719719        else {
    720           sitr++;
     720          ++sitr;
    721721        }
    722722      }
    723723    }
  • include/boost-1_48/boost/date_time/time_facet.hpp

    diff -Naur boost/include/boost-1_48/boost/date_time/time_facet.hpp boost.patched/include/boost-1_48/boost/date_time/time_facet.hpp
    old new  
    12121212
    12131213          }
    12141214          else {  //skip past chars in format and in buffer
    1215             ++itr;
    1216             // set use_current_char when sitr is already
    1217             // pointing at the next character to process
    1218             if (use_current_char) {
    1219               use_current_char = false;
    1220             }
    1221             else {
    1222               ++sitr;
    1223             }
     1215                          if( sitr != stream_end && *itr != *sitr ) {
     1216                                  throw std::exception(); // mismatch in constant non format characters found
     1217                          }
     1218
     1219                          ++itr;
     1220                          // set use_current_char when sitr is already
     1221                          // pointing at the next character to process
     1222                          if (use_current_char) {
     1223                                  use_current_char = false;
     1224                          }
     1225                          else {
     1226                                  ++sitr;
     1227                          }
    12241228          }
    12251229        }
    12261230