cudcv@warwick.ac.uk (Rob McMahon) (12/20/88)
This is the first of a number of messages about bugs in elm 2.1, patchlevel 1. They range in severity from the trivial to the `won't compile without it'. I've split them up into a number of postings so that you can pick and choose. This is one of the more trivial. The builtin pager comes up with some messy messages: e.g. `There are 1 line left (1e2%)', which ain't proper writ, and a bit scientific. This fix changes the %.2g formats to %.0f, which stops you getting `1e2', but loses you a decimal place on < 10, and changes `are' to `is' when there's only one line left. I think (total_lines_to_display - lines_displayed) ought to be given a variable of its own, but this was a minimal change fix. -- RCS file: /usr/local/src/elm/src/builtin.c,v retrieving revision 2.1 retrieving revision 2.1.1.1 diff -c -r2.1 -r2.1.1.1 *** /tmp/,RCSt1a02579 Tue Dec 20 11:25:16 1988 --- /tmp/,RCSt2a02579 Tue Dec 20 11:25:18 1988 *************** *** 124,141 **** StartBold(); if (user_level == 0) sprintf(display_buffer, ! " There are %d line%s left (%.2g%%) : press <space> for more, or 'q' to return ", total_lines_to_display - lines_displayed, plural(total_lines_to_display - lines_displayed), 100.0*(1.0*lines_displayed) / (1.0*total_lines_to_display)); else if (user_level == 1) sprintf(display_buffer, ! " %d line%s more (%.2g%%) : Press <space> for more, 'q' to return ", total_lines_to_display - lines_displayed, plural(total_lines_to_display - lines_displayed), 100.0*(1.0*lines_displayed) / (1.0*total_lines_to_display)); else ! sprintf(display_buffer," %d line%s more (you've seen %.2g%%) ", total_lines_to_display - lines_displayed, plural(total_lines_to_display - lines_displayed), 100.0*(1.0*lines_displayed) / (1.0*total_lines_to_display)); --- 128,146 ---- StartBold(); if (user_level == 0) sprintf(display_buffer, ! " There %s %d line%s left (%.0f%%) : press <space> for more, or 'q' to return ", ! (total_lines_to_display - lines_displayed) == 1 ? "is" : "are", total_lines_to_display - lines_displayed, plural(total_lines_to_display - lines_displayed), 100.0*(1.0*lines_displayed) / (1.0*total_lines_to_display)); else if (user_level == 1) sprintf(display_buffer, ! " %d line%s more (%.0f%%) : Press <space> for more, 'q' to return ", total_lines_to_display - lines_displayed, plural(total_lines_to_display - lines_displayed), 100.0*(1.0*lines_displayed) / (1.0*total_lines_to_display)); else ! sprintf(display_buffer," %d line%s more (you've seen %.0f%%) ", total_lines_to_display - lines_displayed, plural(total_lines_to_display - lines_displayed), 100.0*(1.0*lines_displayed) / (1.0*total_lines_to_display)); -- Rob -- UUCP: ...!mcvax!ukc!warwick!cudcv PHONE: +44 203 523037 JANET: cudcv@uk.ac.warwick ARPA: cudcv@warwick.ac.uk Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England