--- options_description-1.16.cpp 2006-04-18 02:39:51.401147200 +0100 +++ options_description.cpp 2006-04-18 03:04:05.722358400 +0100 @@ -390,13 +390,13 @@ } } - string::const_iterator line_end; + string::const_iterator line_end = line_begin; + unsigned remaining = unsigned(distance(line_begin, par_end)); - line_end = line_begin + line_length; - if (line_end > par_end) - { - line_end = par_end; - } + // line_end will be determined by either the end of the + // current paragraph (remaining), or the current line + // length, which ever is less. + line_end += ((remaining < line_length) ? remaining : line_length); // prevent chopped words // Is line_end between two non-space characters?