tradcpp: upgrade to 0.5.3

This commit is contained in:
Jon Trulson
2019-12-03 18:12:22 -07:00
parent 15dfdf231a
commit ec8f4b7464
28 changed files with 843 additions and 186 deletions

View File

@@ -27,6 +27,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
@@ -172,6 +173,15 @@ output(const struct place *p, const char *buf, size_t len)
linebuf = dorealloc(linebuf, oldmax, linebufmax);
}
if (linebufpos == 0) {
if (!place_samefile(&linebufplace, p)) {
if (mode.output_cheaplinenumbers) {
char str[256];
snprintf(str, sizeof(str), "# %u \"%s\"\n",
p->line, place_getname(p));
dowrite(str, strlen(str));
}
}
linebufplace = *p;
}
memcpy(linebuf + linebufpos, buf, len);