diff options
author | Matthew Newhook <matthew@zeroc.com> | 2009-11-02 11:52:51 -0330 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2009-11-02 11:52:51 -0330 |
commit | 294cf612befb67a690796fdc4617884b43e0d8d5 (patch) | |
tree | 43fa21233e6c5bffc9ffd794707a7125547ad1bc /cpp/src/IceGrid/Client.cpp | |
parent | http://bugzilla/bugzilla/show_bug.cgi?id=4343 - 4343 (diff) | |
download | ice-294cf612befb67a690796fdc4617884b43e0d8d5.tar.bz2 ice-294cf612befb67a690796fdc4617884b43e0d8d5.tar.xz ice-294cf612befb67a690796fdc4617884b43e0d8d5.zip |
http://bugzilla/bugzilla/show_bug.cgi?id=4341 - ^D at username prompt makes icegridadmin go bananas
Diffstat (limited to 'cpp/src/IceGrid/Client.cpp')
-rw-r--r-- | cpp/src/IceGrid/Client.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/cpp/src/IceGrid/Client.cpp b/cpp/src/IceGrid/Client.cpp index ad68747e51a..074d479d040 100644 --- a/cpp/src/IceGrid/Client.cpp +++ b/cpp/src/IceGrid/Client.cpp @@ -439,16 +439,24 @@ Client::run(int argc, char* argv[]) } else { - while(id.empty()) + while(id.empty() && cin.good()) { cout << "user id: " << flush; getline(cin, id); + if(!cin.good()) + { + return EXIT_FAILURE; + } id = IceUtilInternal::trim(id); } if(password.empty()) { password = getPassword("password: "); + if(!cin.good()) + { + return EXIT_FAILURE; + } } session = AdminSessionPrx::uncheckedCast(router->createSession(id, password)); @@ -574,16 +582,24 @@ Client::run(int argc, char* argv[]) } else { - while(id.empty()) + while(id.empty() && cin.good()) { cout << "user id: " << flush; getline(cin, id); + if(!cin.good()) + { + return EXIT_FAILURE; + } id = IceUtilInternal::trim(id); } if(password.empty()) { password = getPassword("password: "); + if(!cin.good()) + { + return EXIT_FAILURE; + } } session = registry->createAdminSession(id, password); |