From eacdc426d76a88aa9b6efc698106d3f36a774905 Mon Sep 17 00:00:00 2001 From: grischka Date: Sat, 1 Oct 2016 20:19:37 +0200 Subject: libtcc: cleanup @listfile Also: - allow more than one item per line - respect "quoted items" and escaped quotes \" (also for LIBTCCAPI tcc_setoptions) - cleanup some copy & paste --- tccpe.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tccpe.c') diff --git a/tccpe.c b/tccpe.c index 4069e51..83acc2f 100644 --- a/tccpe.c +++ b/tccpe.c @@ -1565,6 +1565,23 @@ quit: return ret; } +/* ------------------------------------------------------------- */ + +static char *trimfront(char *p) +{ + while (*p && (unsigned char)*p <= ' ') + ++p; + return p; +} + +static char *trimback(char *a, char *e) +{ + while (e > a && (unsigned char)e[-1] <= ' ') + --e; + *e = 0;; + return a; +} + /* ------------------------------------------------------------- */ static int pe_load_def(TCCState *s1, int fd) { -- cgit v1.3.1