mirror of
https://github.com/intel/llvm.git
synced 2026-02-04 20:00:11 +08:00
Make sure the getopt variables are correctly initialized for any option parsing.
Added a new "--port-offset PORT" option to lldb-platform so it can be used with USB mux type scenarios. llvm-svn: 195486
This commit is contained in:
@@ -878,6 +878,14 @@ main (int argc, char *argv[])
|
||||
}
|
||||
// NULL terminate the short option string.
|
||||
short_options[short_options_idx++] = '\0';
|
||||
|
||||
#if __GLIBC__
|
||||
optind = 0;
|
||||
#else
|
||||
optreset = 1;
|
||||
optind = 1;
|
||||
#endif
|
||||
|
||||
while ((ch = getopt_long_only(argc, argv, short_options, g_long_options, &long_option_index)) != -1)
|
||||
{
|
||||
DNBLogDebug("option: ch == %c (0x%2.2x) --%s%c%s\n",
|
||||
|
||||
Reference in New Issue
Block a user