1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-11-19 02:56:08 -05:00

buffer-position (CTL-X =) reports 100% ratio when at end of file even for empty buffer.

This commit is contained in:
Renaud 2020-05-10 12:07:08 +08:00
parent 3807410154
commit 659ada8b64

View File

@ -112,9 +112,8 @@ int showcpos(int f, int n)
ecol = getccol(FALSE); ecol = getccol(FALSE);
curwp->w_doto = savepos; curwp->w_doto = savepos;
ratio = 0; /* Ratio before dot. */ /* Ratio before dot. */
if (numchars != 0) ratio = (numchars == 0) ? 100 : (100L * predchars) / numchars ;
ratio = (100L * predchars) / numchars;
/* summarize and report the info */ /* summarize and report the info */
char fmtbuf[] = "Line %d/%d Col %d/%d Char %D/%D (%d%%) char = %s%x" ; char fmtbuf[] = "Line %d/%d Col %d/%d Char %D/%D (%d%%) char = %s%x" ;