Move lastLine setter into conditional block to prevent .commands and blank lines from setting lastLine

This commit is contained in:
Daniel G. Taylor
2013-04-07 11:28:59 -07:00
parent feaea49eac
commit 0e2d2ea637
2 changed files with 2 additions and 2 deletions

View File

@@ -115,8 +115,8 @@
repl.rli.addListener('line', function(code) {
if (code && code.length && code !== '.history' && lastLine !== code) {
fs.write(fd, "" + code + "\n");
return lastLine = code;
}
return lastLine = code;
});
process.on('exit', function() {
return fs.closeSync(fd);