# HG changeset patch
# User David A. Holland
# Date 1364691179 14400
# Node ID 70902cac4170e20ca74410ca145b966d9c9ddece
# Parent  a489cc223483bb1ee1548b0acefc088cc7ffc24c
Sort the option lists to match the comparison used to search them. duh.
Also don't assert on the incpaths during shutdown.

diff -r a489cc223483 -r 70902cac4170 main.c
--- a/main.c	Sat Mar 30 20:39:59 2013 -0400
+++ b/main.c	Sat Mar 30 20:52:59 2013 -0400
@@ -315,6 +315,11 @@
 void
 incpath_cleanup(void)
 {
+	stringarray_setsize(&incpath_quote, 0);
+	stringarray_setsize(&incpath_user, 0);
+	stringarray_setsize(&incpath_system, 0);
+	stringarray_setsize(&incpath_late, 0);
+
 	stringarray_cleanup(&incpath_quote);
 	stringarray_cleanup(&incpath_user);
 	stringarray_cleanup(&incpath_system);
@@ -712,13 +717,9 @@
 static const struct flag_option flag_options[] = {
 	{ "C",                          &mode.output_retain_comments,  true },
 	{ "CC",                         &mode.output_retain_comments,  true },
-	{ "fdollars-in-identifiers",    &mode.input_allow_dollars,     true },
-	{ "fno-dollars-in-identifiers", &mode.input_allow_dollars,     false },
 	{ "MG",                         &mode.depend_assume_generated, true },
 	{ "MP",                         &mode.depend_issue_fakerules,  true },
-	{ "nostdinc",                   &mode.do_stdinc,               false },
 	{ "P",                          &mode.output_linenumbers,      false },
-	{ "undef",                      &mode.do_stddef,               false },
 	{ "Wcomment",                   &warns.nestcomment,    true },
 	{ "Wendif-labels",              &warns.endiflabels,    true },
 	{ "Werror",                     &mode.werror,          true },
@@ -729,14 +730,14 @@
 	{ "Wno-unused-macros",          &warns.unused,         false },
 	{ "Wundef",                     &warns.undef,          true },
 	{ "Wunused-macros",             &warns.unused,         true },
+	{ "fdollars-in-identifiers",    &mode.input_allow_dollars,     true },
+	{ "fno-dollars-in-identifiers", &mode.input_allow_dollars,     false },
+	{ "nostdinc",                   &mode.do_stdinc,               false },
+	{ "undef",                      &mode.do_stddef,               false },
 };
 static const unsigned num_flag_options = HOWMANY(flag_options);
 
 static const struct act_option act_options[] = {
-	{ "dD",        commandline_dD },
-	{ "dI",        commandline_dI },
-	{ "dM",        commandline_dM },
-	{ "dN",        commandline_dN },
 	{ "H",         commandline_H },
 	{ "M",         commandline_M },
 	{ "MD",        commandline_MD },
@@ -744,20 +745,27 @@
 	{ "MMD",       commandline_MMD },
 	{ "Wall",      commandline_wall },
 	{ "Wno-all",   commandline_wnoall },
+	{ "dD",        commandline_dD },
+	{ "dI",        commandline_dI },
+	{ "dM",        commandline_dM },
+	{ "dN",        commandline_dN },
 	{ "w",         commandline_wnone },
 };
 static const unsigned num_act_options = HOWMANY(act_options);
 
 static const struct prefix_option prefix_options[] = {
 	{ "D",         commandline_def },
+	{ "I",         commandline_addincpath_user },
+	{ "U",         commandline_undef },
 	{ "ftabstop=", commandline_tabstop },
-	{ "I",         commandline_addincpath_user },
 	{ "std=",      commandline_setstd },
-	{ "U",         commandline_undef },
 };
 static const unsigned num_prefix_options = HOWMANY(prefix_options);
 
 static const struct arg_option arg_options[] = {
+	{ "MF",          commandline_setdependoutput },
+	{ "MQ",          commandline_setdependtarget_quoted },
+	{ "MT",          commandline_setdependtarget },
 	{ "idirafter",   commandline_addincpath_late },
 	{ "imacros",     commandline_addfile_nooutput },
 	{ "include",     commandline_addfile_output },
@@ -768,9 +776,6 @@
 	{ "isystem",     commandline_addincpath_system },
 	{ "iwithprefix", commandline_addincpath_late_withprefix },
 	{ "iwithprefixbefore", commandline_addincpath_user_withprefix },
-	{ "MF",          commandline_setdependoutput },
-	{ "MT",          commandline_setdependtarget },
-	{ "MQ",          commandline_setdependtarget_quoted },
 	{ "x",           commandline_setlang },
 };
 static const unsigned num_arg_options = HOWMANY(arg_options);