X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/291f47791d2c0d8521922c8d3090e2aa6f099d5b..453b82a388013e522b3a1b9fcd6ed0810dab1f4f:/apt-pkg/contrib/progress.cc diff --git a/apt-pkg/contrib/progress.cc b/apt-pkg/contrib/progress.cc index 17a6b70e9..4ff4f181d 100644 --- a/apt-pkg/contrib/progress.cc +++ b/apt-pkg/contrib/progress.cc @@ -14,6 +14,8 @@ #include #include +#include +#include #include #include #include @@ -125,14 +127,14 @@ bool OpProgress::CheckChange(float Interval) // OpTextProgress::OpTextProgress - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -OpTextProgress::OpTextProgress(Configuration &Config) : - NoUpdate(false), NoDisplay(false), LastLen(0) +OpTextProgress::OpTextProgress(Configuration &Config) : + NoUpdate(false), NoDisplay(false), LastLen(0) { if (Config.FindI("quiet",0) >= 1 || Config.FindB("quiet::NoUpdate", false) == true) NoUpdate = true; if (Config.FindI("quiet",0) >= 2) NoDisplay = true; -}; +} /*}}}*/ // OpTextProgress::Done - Clean up the display /*{{{*/ // --------------------------------------------------------------------- @@ -150,12 +152,12 @@ void OpTextProgress::Done() cout << endl; OldOp = string(); } - + if (NoUpdate == true && NoDisplay == false && OldOp.empty() == false) { OldOp = string(); - cout << endl; - } + cout << endl; + } } /*}}}*/ // OpTextProgress::Update - Simple text spinner /*{{{*/ @@ -192,7 +194,7 @@ void OpTextProgress::Update() } // Print the spinner - snprintf(S,sizeof(S),_("\r%s... %u%%"),Op.c_str(),(unsigned int)Percent); + snprintf(S,sizeof(S),_("%c%s... %u%%"),'\r',Op.c_str(),(unsigned int)Percent); Write(S); OldOp = Op;