comparison lwasm/list.c @ 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 6237505ee1dc
children
comparison
equal deleted inserted replaced
572:de527b99d881 573:0ae10ecfba1e
219 } 219 }
220 else 220 else
221 { 221 {
222 linespec = cl -> linespec; 222 linespec = cl -> linespec;
223 if ((strlen(linespec) > 8) && (linespec[7] == ':')) linespec += 8; 223 if ((strlen(linespec) > 8) && (linespec[7] == ':')) linespec += 8;
224 if (strlen(linespec) > max_linespec_len)
225 linespec += strlen(linespec) - max_linespec_len;
224 while (*linespec == ' ') linespec++; 226 while (*linespec == ' ') linespec++;
225 227
226 if (of) fprintf(of, "(%*.*s):%05d ", max_linespec_len, max_linespec_len, linespec, cl->lineno); 228 if (of) fprintf(of, "(%*.*s):%05d ", max_linespec_len, max_linespec_len, linespec, cl->lineno);
227 } 229 }
228 230