Author: jkupec Date: Fri Nov 30 17:47:16 2007 New Revision: 8000 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8000&view=rev Log: - using break to quit shell Modified: trunk/zypper/src/zypper.cc Modified: trunk/zypper/src/zypper.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=8000&r1=7999&r2=8000&view=diff ============================================================================== --- trunk/zypper/src/zypper.cc (original) +++ trunk/zypper/src/zypper.cc Fri Nov 30 17:47:16 2007 @@ -401,8 +401,7 @@ if (!histfile.empty ()) read_history (histfile.c_str ()); - bool loop = true; - while (loop) { + while (true) { // reset globals setRunningHelp(false); @@ -420,26 +419,24 @@ if (command_str == "\004") // ^D { - loop = false; cout << endl; // print newline after ^D + break; } - else + + try { - try - { - setCommand(ZypperCommand(command_str)); - if (command() == ZypperCommand::SHELL_QUIT) - loop = false; - else if (command() == ZypperCommand::SHELL) - cout << _("You already are running zypper's shell.") << endl; - else - safeDoCommand(); - } - catch (Exception & e) - { - cerr << e.msg() << endl; - print_unknown_command_hint(); - } + setCommand(ZypperCommand(command_str)); + if (command() == ZypperCommand::SHELL_QUIT) + break; + else if (command() == ZypperCommand::SHELL) + cout << _("You already are running zypper's shell.") << endl; + else + safeDoCommand(); + } + catch (Exception & e) + { + cerr << e.msg() << endl; + print_unknown_command_hint(); } if (exiting()) -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org