prevent loop when none input
This commit is contained in:
		
							parent
							
								
									5dc2457a15
								
							
						
					
					
						commit
						c0ce3b7bff
					
				@ -1,7 +1,7 @@
 | 
				
			|||||||
#![allow(dead_code)]
 | 
					#![allow(dead_code)]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/// Manage UCI messages and link into chess component
 | 
					/// Manage UCI messages and link into chess component
 | 
				
			||||||
mod uci_command;
 | 
					pub mod uci_command;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use log::{info, warn};
 | 
					use log::{info, warn};
 | 
				
			||||||
use std::io::*;
 | 
					use std::io::*;
 | 
				
			||||||
@ -63,10 +63,12 @@ impl<Fi: Read, Fo:  Write> UciEngine<Fi, Fo> {
 | 
				
			|||||||
        self.push(GuiCommand::Uci);
 | 
					        self.push(GuiCommand::Uci);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Consume commands until uciok messages
 | 
					        // Consume commands until uciok messages
 | 
				
			||||||
 | 
					        if self.source.is_some() {
 | 
				
			||||||
            while !self.uciok {
 | 
					            while !self.uciok {
 | 
				
			||||||
                self.pull();
 | 
					                self.pull();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /// Initialize a new game
 | 
					    /// Initialize a new game
 | 
				
			||||||
    ///
 | 
					    ///
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user