Skip to content

Commit

Permalink
Merge branch 'streaming' of git://github.com/frx/shogun
Browse files Browse the repository at this point in the history
  • Loading branch information
Soeren Sonnenburg committed Jun 8, 2011
2 parents 95b4248 + c8e2553 commit 5c3d0b9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libshogun/lib/AsciiFile.cpp
Expand Up @@ -1055,6 +1055,8 @@ ssize_t CAsciiFile::getdelim(char **lineptr, size_t *n, char delimiter, FILE *st

if (pos==-1)
{
if (feof(stream))
return -1;
total_bytes_read+=bytes_read;
*lineptr=(char*) SG_REALLOC(*lineptr, (*n)*2);
*n=(*n)*2;
Expand All @@ -1064,6 +1066,8 @@ ssize_t CAsciiFile::getdelim(char **lineptr, size_t *n, char delimiter, FILE *st
{
total_bytes_read+=pos+1;
(*lineptr)[total_bytes_read]='\0';
// Seek back to position after \n
fseek(stream, (bytes_read-pos-1) * -1, SEEK_CUR);
return total_bytes_read;
}
}
Expand Down

0 comments on commit 5c3d0b9

Please sign in to comment.