Changeset 479


Ignore:
Timestamp:
Sep 12, 2007, 12:21:18 AM (16 years ago)
Author:
Jari Häkkinen
Message:

Removed division by zero when an author has no contribution for a line type.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.6-stable/lib/first_page.cc

    r451 r479  
    139139        os << anchor(string(i->author()+"/total/index.html"),i->author());
    140140      os << "</td><td>" << stats.lines(i->author()) << " ("
    141          << 100*stats.lines(i->author())/stats.lines() << "%)</td>"
    142          << "<td>" << stats.code(i->author()) << " ("
    143          << 100*stats.code(i->author())/stats.code() << "%)</td>"
    144          << "<td>" << stats.comments(i->author()) << " ("
    145          << 100*stats.comments(i->author())/stats.comments() << "%)</td>"
    146          << "<td>" << i->date()(timefmt) << "</td>"
     141         << 100*stats.lines(i->author())/(stats.lines()?stats.lines():1)
     142         << "%)</td><td>" << stats.code(i->author()) << " ("
     143         << 100*stats.code(i->author())/(stats.code()?stats.code():1)
     144         << "%)</td><td>" << stats.comments(i->author()) << " ("
     145         << 100*stats.comments(i->author())/(stats.comments()?stats.comments():1)
     146         << "%)</td><td>" << i->date()(timefmt) << "</td>"
    147147         <<"</tr>";
    148148    }
Note: See TracChangeset for help on using the changeset viewer.