]> git.donarmstrong.com Git - mothur.git/blobdiff - aligncommand.cpp
added list.seqs command
[mothur.git] / aligncommand.cpp
index 0f5c86f5bf1cdc73f048a4c6a7a52b928875bbee..5af8e959a6caa3edd98a33a21fa680bd5815d2dc 100644 (file)
@@ -195,10 +195,12 @@ int AlignCommand::execute(){
                        ifstream inFASTA;
                        openInputFile(candidateFileName, inFASTA);
                        
+                       string input;
                        while(!inFASTA.eof()){
-                               char c = inFASTA.get();
-                               if(c == '>'){   int pos = inFASTA.tellg(); positions.push_back(pos-1);  }
-                               while (!inFASTA.eof())  {       c = inFASTA.get(); if (c == 10 || c == 13){     break;  }       } // get rest of line if there's any crap there
+                               getline(inFASTA, input);
+                               if (input.length() != 0) {
+                                       if(input[0] == '>'){    int pos = inFASTA.tellg(); positions.push_back(pos - input.length() - 1);       }
+                               }
                        }
                        inFASTA.close();