1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-12-17 23:06:25 -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);
curwp->w_doto = savepos;
ratio = 0; /* Ratio before dot. */
if (numchars != 0)
ratio = (100L * predchars) / numchars;
/* Ratio before dot. */
ratio = (numchars == 0) ? 100 : (100L * predchars) / numchars ;
/* summarize and report the info */
char fmtbuf[] = "Line %d/%d Col %d/%d Char %D/%D (%d%%) char = %s%x" ;