Mercurial > hg > index.cgi
changeset 573:0ae10ecfba1e
Make filename in listing left truncate so file name isn't hidden
It's not helpful to show the path prefix when the name is too long so
truncate that instead of the trailing part of the file name string when
the name is too long to fit the listing field.
author | William Astle <lost@l-w.ca> |
---|---|
date | Fri, 02 Feb 2024 14:39:27 -0700 |
parents | de527b99d881 |
children | a0c9433dc0d4 |
files | lwasm/list.c |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/lwasm/list.c Fri Dec 22 21:59:41 2023 -0700 +++ b/lwasm/list.c Fri Feb 02 14:39:27 2024 -0700 @@ -221,6 +221,8 @@ { linespec = cl -> linespec; if ((strlen(linespec) > 8) && (linespec[7] == ':')) linespec += 8; + if (strlen(linespec) > max_linespec_len) + linespec += strlen(linespec) - max_linespec_len; while (*linespec == ' ') linespec++; if (of) fprintf(of, "(%*.*s):%05d ", max_linespec_len, max_linespec_len, linespec, cl->lineno);