From 1210745bf035e1667540d81af75d5fd58b75ed40 Mon Sep 17 00:00:00 2001 From: "beard%netscape.com" Date: Fri, 5 May 2000 04:19:20 +0000 Subject: [PATCH] EOF handling --- js/js2/debugger.cpp | 4 +++- js2/src/debugger.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/js/js2/debugger.cpp b/js/js2/debugger.cpp index 170497e1c7b..852127a4102 100644 --- a/js/js2/debugger.cpp +++ b/js/js2/debugger.cpp @@ -200,7 +200,9 @@ registers, or set the value of a single register."}, printFormat (stdOut, "%04X", (pc - iCode->its_iCode->begin())); stdOut << "]> "; - std::getline(mIn, line); + if (std::getline(mIn, line).eof()) + std::exit(0); + if (line.size() == 0) line = lastLine; else diff --git a/js2/src/debugger.cpp b/js2/src/debugger.cpp index 170497e1c7b..852127a4102 100644 --- a/js2/src/debugger.cpp +++ b/js2/src/debugger.cpp @@ -200,7 +200,9 @@ registers, or set the value of a single register."}, printFormat (stdOut, "%04X", (pc - iCode->its_iCode->begin())); stdOut << "]> "; - std::getline(mIn, line); + if (std::getline(mIn, line).eof()) + std::exit(0); + if (line.size() == 0) line = lastLine; else