Skip to content

Commit

Permalink
Backport fix to 1.2 branch. SERVER-410.
Browse files Browse the repository at this point in the history
  • Loading branch information
RedBeard0531 committed Dec 29, 2009
1 parent f8f12e8 commit 961d3ab
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tools/import.cpp
Expand Up @@ -198,13 +198,14 @@ class Import : public Tool {
log(1) << "filesize: " << fileSize << endl;
ProgressMeter pm( fileSize );
const int BUF_SIZE = 1024 * 1024 * 4;
char line[ (1024 * 1024 * 4) + 128];
boost::scoped_array<char> line (new char[BUF_SIZE]);
while ( *in ){
in->getline( line , BUF_SIZE );
char * buf = line.get();

in->getline( buf , BUF_SIZE );
uassert( "unknown error reading file" , ( in->rdstate() & ios_base::badbit ) == 0 );
log(1) << "got line:" << line << endl;
log(1) << "got line:" << buf << endl;

char * buf = line;
while( isspace( buf[0] ) ) buf++;

int len = strlen( buf );
Expand Down

0 comments on commit 961d3ab

Please sign in to comment.