- pushTok.copy(buff, string::npos);
- buff[pushTok.length()] = '\0';
- pushTok.erase();
- return true;
+ // There can have been a whole line pushed so
+ // we extract the first word and leaves the rest
+ // in pushTok. (Lgb)
+ if (pushTok.find(' ') != string::npos) {
+ string tmp;
+ pushTok = split(pushTok, tmp, ' ');
+ tmp.copy(buff, string::npos);
+ buff[tmp.length()] = '\0';
+ return true;
+ } else {
+ pushTok.copy(buff, string::npos);
+ buff[pushTok.length()] = '\0';
+ pushTok.erase();
+ return true;
+ }