X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/b2e465d6d32d2dc884f58b94acb7e35f671a87fe..a4977aac2bc7999f805550e3bcd5fe49958fe128:/cmdline/acqprogress.cc?ds=sidebyside diff --git a/cmdline/acqprogress.cc b/cmdline/acqprogress.cc index e7b6b9ab8..a5fee1db5 100644 --- a/cmdline/acqprogress.cc +++ b/cmdline/acqprogress.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: acqprogress.cc,v 1.21 2001/02/20 07:03:17 jgg Exp $ +// $Id: acqprogress.cc,v 1.24 2003/04/27 01:56:48 doogie Exp $ /* ###################################################################### Acquire Progress - Command line progress meter @@ -18,8 +18,11 @@ #include #include +#include /*}}}*/ +using namespace std; + // AcqTextStatus::AcqTextStatus - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -149,7 +152,7 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner) enum {Long = 0,Medium,Short} Mode = Long; - char Buffer[1024]; + char Buffer[sizeof(BlankLine)]; char *End = Buffer + sizeof(Buffer); char *S = Buffer; if (ScreenWidth >= sizeof(Buffer)) @@ -265,15 +268,22 @@ bool AcqTextStatus::MediaChange(string Media,string Drive) { if (Quiet <= 0) cout << '\r' << BlankLine << '\r'; - ioprintf(cout,_("Media Change: Please insert the disc labeled '%s' in " - "the drive '%s' and press enter\n"), + ioprintf(cout,_("Media change: please insert the disc labeled\n" + " '%s'\n" + "in the drive '%s' and press enter\n"), Media.c_str(),Drive.c_str()); char C = 0; + bool bStatus = true; while (C != '\n' && C != '\r') - read(STDIN_FILENO,&C,1); - - Update = true; - return true; + { + int len = read(STDIN_FILENO,&C,1); + if(C == 'c' || len <= 0) + bStatus = false; + } + + if(bStatus) + Update = true; + return bStatus; } /*}}}*/