Author: mvidner Date: Tue Jun 19 12:53:35 2007 New Revision: 5785 URL: http://svn.opensuse.org/viewcvs/zypp?rev=5785&view=rev Log: Fixed an endless loop in Abort/Retry/Ignore (#269263). Modified: trunk/zypper/package/zypper.changes trunk/zypper/src/zypper-callbacks.cc Modified: trunk/zypper/package/zypper.changes URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/package/zypper.changes?rev=5785&r1=5784&r2=5785&view=diff ============================================================================== --- trunk/zypper/package/zypper.changes (original) +++ trunk/zypper/package/zypper.changes Tue Jun 19 12:53:35 2007 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Tue Jun 19 12:53:23 CEST 2007 - mvidner@suse.cz + +- Fixed an endless loop in Abort/Retry/Ignore (#269263). + +------------------------------------------------------------------- Mon Jun 4 22:32:52 CEST 2007 - jkupec@suse.cz - fixed changed log file path also in zypper.lr Modified: trunk/zypper/src/zypper-callbacks.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-callbacks.cc?rev=5785&r1=5784&r2=5785&view=diff ============================================================================== --- trunk/zypper/src/zypper-callbacks.cc (original) +++ trunk/zypper/src/zypper-callbacks.cc Tue Jun 19 12:53:35 2007 @@ -22,17 +22,13 @@ int read_action_ari (int default_action) { cout << _("(A)bort, (R)etry, (I)gnore?") << " "; // don't translate letters in parentheses!! + // abort if no default has been specified + if (default_action == -1) { + default_action = 0; + } + // non-interactive mode if (gSettings.non_interactive) { - // abort if no default has been specified - if (default_action == -1) { - // print the answer for convenience - cout << 'a' << endl; - - return 0; - } - // return the specified default - else { char c; switch (default_action) { case 0: c = 'a'; break; @@ -44,11 +40,10 @@ cout << c << endl; return default_action; - } } // interactive mode, ask user - while (true) { + while (cin.good()) { // #269263 char c; cin >> c; c = tolower (c); @@ -60,6 +55,8 @@ return 2; cout << "?" << endl; } + + return default_action; } string to_string (zypp::Resolvable::constPtr resolvable) { -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org