From: Ben Pfaff Date: Mon, 16 Aug 2010 22:54:47 +0000 (-0700) Subject: ovs-vsctl: Fix parsing of short SSL options. X-Git-Tag: v1.1.0pre1~84 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;ds=sidebyside;h=a2a9d2d9df6fdc80438760b7e343baba7dcc817d;hp=d006d0ccb0bc2f227b5765577f69c9ad77353b91;p=sliver-openvswitch.git ovs-vsctl: Fix parsing of short SSL options. The short versions of the SSL options (e.g. -p, -c, -C) did not work, because they were not in the string passed to getopt_long(). This commit fixes the problem and should avoid its recurrence with any other short options that we add in the future. --- diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c index d68e4740a..4d50194aa 100644 --- a/utilities/ovs-vsctl.c +++ b/utilities/ovs-vsctl.c @@ -182,12 +182,16 @@ parse_options(int argc, char *argv[]) #endif {0, 0, 0, 0}, }; + char *tmp, *short_options; + tmp = long_options_to_short_options(long_options); + short_options = xasprintf("+%s", tmp); + free(tmp); for (;;) { int c; - c = getopt_long(argc, argv, "+v::hVt:", long_options, NULL); + c = getopt_long(argc, argv, short_options, long_options, NULL); if (c == -1) { break; } @@ -245,6 +249,7 @@ parse_options(int argc, char *argv[]) abort(); } } + free(short_options); if (!db) { db = default_db();