aboutsummaryrefslogtreecommitdiff
path: root/tccpe.c
diff options
context:
space:
mode:
authorgrischka <grischka>2016-10-01 20:19:37 +0200
committergrischka <grischka>2016-10-01 20:19:37 +0200
commiteacdc426d76a88aa9b6efc698106d3f36a774905 (patch)
treef20ac27ca31fb9a98e366e430f11bd80e2ce3c8c /tccpe.c
parent09a487eb2b2bcabeaeec8d2c7ca422993df0efb5 (diff)
downloadtinycc-eacdc426d76a88aa9b6efc698106d3f36a774905.tar.gz
tinycc-eacdc426d76a88aa9b6efc698106d3f36a774905.tar.bz2
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
Diffstat (limited to 'tccpe.c')
-rw-r--r--tccpe.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tccpe.c b/tccpe.c
index 4069e51..83acc2f 100644
--- a/tccpe.c
+++ b/tccpe.c
@@ -1566,6 +1566,23 @@ quit:
}
/* ------------------------------------------------------------- */
+
+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)
{
int state = 0, ret = -1, dllindex = 0, ord;