# HG changeset patch # User William Astle # Date 1391570195 25200 # Node ID dc763f806dc41ab8e75c46e66499631ac6b4db44 # Parent bcd1daabdb2e949e715504f0363f36289abda1e4 Left truncate file names in list output. Thanks to Tormod Volden (lists.tormod@gmail.com) for providing this patch to truncate long file names on the left instead of the right when producing the listing output. diff -r bcd1daabdb2e -r dc763f806dc4 lwasm/list.c --- a/lwasm/list.c Fri Jan 10 18:59:26 2014 -0700 +++ b/lwasm/list.c Tue Feb 04 20:16:35 2014 -0700 @@ -65,6 +65,9 @@ for (cl = as -> line_head; cl; cl = nl) { + char *linespec; + int linespec_len; + nl = cl -> next; if (CURPRAGMA(cl, PRAGMA_NOLIST)) { @@ -193,7 +196,13 @@ } /* the 32.32 below is deliberately chosen so that the start of the line text is at a multiple of 8 from the start of the list line */ - fprintf(of, "(%32.32s):%05d ", cl -> linespec, cl -> lineno); + linespec = cl -> linespec; + linespec_len = strlen(linespec); + if (linespec_len > 32) + { + linespec += linespec_len - 32; + } + fprintf(of, "(%32.32s):%05d ", linespec, cl -> lineno); i = 0; for (tc = cl -> ltext; *tc; tc++) {