code cleanup

git-svn-id: https://svn.code.sf.net/p/porg/code/trunk@153 8854956c-c02d-4db9-8198-7e99b8e08f37
This commit is contained in:
davidrr 2015-05-01 06:31:25 +00:00
parent a635f86e90
commit ad6340032a
2 changed files with 6 additions and 7 deletions

View File

@ -135,7 +135,7 @@ string BasePkg::description_str(bool debug /* = false */) const
else {
std::istringstream is(m_description);
for (string buf; getline(is, buf); )
desc += '\n' + head + " " + buf;
desc += "\n" + head + " " + buf;
}
return desc;
@ -144,16 +144,16 @@ string BasePkg::description_str(bool debug /* = false */) const
string BasePkg::format_description() const
{
string code(string("#") + CODE_DESCRIPTION + ':');
string code(string("#") + CODE_DESCRIPTION + ":");
if (m_description.empty())
return code + '\n';
return code + "\n";
string ret;
std::istringstream is(m_description);
for (string buf; getline(is, buf); )
ret += code + buf + '\n';
ret += code + buf + "\n";
return ret;
}
@ -236,7 +236,7 @@ void BasePkg::sort_files( sort_t type, // = SORT_BY_NAME
string BasePkg::get_base(string const& name)
{
for (string::size_type i = 1; i < name.size(); ++i) {
for (uint i = 1; i < name.size(); ++i) {
if (isdigit(name.at(i)) && name.at(i - 1) == '-')
return name.substr(0, i - 1);
}
@ -246,7 +246,7 @@ string BasePkg::get_base(string const& name)
string BasePkg::get_version(string const& name)
{
for (string::size_type i = 1; i < name.size(); ++i) {
for (uint i = 1; i < name.size(); ++i) {
if (isdigit(name.at(i)) && name.at(i - 1) == '-')
return name.substr(i);
}

View File

@ -81,7 +81,6 @@ string Porg::fmt_date(time_t date, bool print_hour)
}
//
// Match @inpath against each path in @list, following the standard shell-like
// expansion, but with the following exception: If a path in the list does not