code cleanup
git-svn-id: https://svn.code.sf.net/p/porg/code/trunk@157 8854956c-c02d-4db9-8198-7e99b8e08f37
This commit is contained in:
parent
8e3255eeda
commit
3f376e8ccc
|
@ -110,7 +110,7 @@ string strip_repeated(string const& str, char c)
|
|||
|
||||
|
||||
//
|
||||
// Strip trailing occurrences of character i@c in @str. If all characters in
|
||||
// Strip trailing occurrences of character @c in @str. If all characters in
|
||||
// @str are @c, leave one of them unstripped.
|
||||
//
|
||||
string Porg::strip_trailing(string const& str, char c)
|
||||
|
|
|
@ -70,10 +70,8 @@ void DB::get_pkgs(vector<string> const& args)
|
|||
|
||||
bool found = false;
|
||||
|
||||
for (string name; dir.read(name); ) {
|
||||
if (match_pkg(args[i], name) && add_pkg(name))
|
||||
found = true;
|
||||
}
|
||||
for (string name; dir.read(name); )
|
||||
found |= (match_pkg(args[i], name) && add_pkg(name));
|
||||
|
||||
if (!found) {
|
||||
Out::vrb("porg: " + args[i] + ": Package not logged");
|
||||
|
|
|
@ -21,11 +21,9 @@ void Out::vrb(string const& msg, int errno_ /* = 0 */)
|
|||
{
|
||||
if (verbose()) {
|
||||
if (errno_)
|
||||
cerr << "porg: ";
|
||||
cerr << msg;
|
||||
if (errno_)
|
||||
cerr << ": " << strerror(errno_);
|
||||
cerr << '\n';
|
||||
cerr << "porg: " << msg << ": " << strerror(errno_) << "\n";
|
||||
else
|
||||
cerr << msg << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue