diff options
Diffstat (limited to 'util-linux/getopt.c')
| -rw-r--r-- | util-linux/getopt.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/util-linux/getopt.c b/util-linux/getopt.c index 213bfab0b..e61d68982 100644 --- a/util-linux/getopt.c +++ b/util-linux/getopt.c | |||
| @@ -412,6 +412,11 @@ int getopt_main(int argc, char **argv) | |||
| 412 | bb_simple_error_msg_and_die("missing optstring argument"); | 412 | bb_simple_error_msg_and_die("missing optstring argument"); |
| 413 | } | 413 | } |
| 414 | 414 | ||
| 415 | #if ENABLE_PLATFORM_MINGW32 | ||
| 416 | // Mingw-w64 getopt(3) uses __argv[0] in error messages, not the | ||
| 417 | // first element of its argument array. | ||
| 418 | __argv[0] = | ||
| 419 | #endif | ||
| 415 | argv[n] = name ? name : argv[0]; | 420 | argv[n] = name ? name : argv[0]; |
| 416 | return generate_output(argv + n, argc - n, optstr, long_options); | 421 | return generate_output(argv + n, argc - n, optstr, long_options); |
| 417 | } | 422 | } |
