Corrected small bug in the tokenizer (it would add a fake token for lines ending with a space before /n)

This commit is contained in:
Paolo Cignoni 2004-11-23 11:56:50 +00:00
parent 96d8ae7ec0
commit b5553ec6ca
1 changed files with 14 additions and 5 deletions

View File

@ -19,6 +19,12 @@
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) *
* for more details. *
* *
****************************************************************************/
/****************************************************************************
History
$Log: not supported by cvs2svn $
****************************************************************************/
#ifndef __VCGLIB_IMPORT_OFF
@ -285,11 +291,14 @@ namespace vcg
{
while (line[from]==' ' && from!=length)
from++;
to = from+1;
while (line[to]!=' ' && to!=length)
to++;
tokens.push_back(line.substr(from, to-from).c_str());
from = to;
if(from!=length)
{
to = from+1;
while (line[to]!=' ' && to!=length)
to++;
tokens.push_back(line.substr(from, to-from).c_str());
from = to;
}
}
while (from<length);
} // end Tokenize