diff options
Diffstat (limited to 'tool/lemon.c')
-rw-r--r-- | tool/lemon.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tool/lemon.c b/tool/lemon.c index 06b9109a1..d92df2a1a 100644 --- a/tool/lemon.c +++ b/tool/lemon.c @@ -1709,6 +1709,15 @@ static void stats_line(const char *zLabel, int iValue){ iValue); } +/* +** Comparison function used by qsort() to sort the azDefine[] array. +*/ +static int defineCmp(const void *pA, const void *pB){ + const char *zA = *(const char**)pA; + const char *zB = *(const char**)pB; + return strcmp(zA,zB); +} + /* The main program. Parse the command line and do it... */ int main(int argc, char **argv){ static int version = 0; @@ -1764,6 +1773,7 @@ int main(int argc, char **argv){ } memset(&lem, 0, sizeof(lem)); lem.errorcnt = 0; + qsort(azDefine, nDefine, sizeof(azDefine[0]), defineCmp); /* Initialize the machine */ Strsafe_init(); |