052-fix-getopt_long_only-misinterpreting-as-an-option.patch 844 B

123456789101112131415161718192021222324
  1. From b24f1d2520c87077cef21e085893e5f3c565a6df Mon Sep 17 00:00:00 2001
  2. From: Rich Felker <[email protected]>
  3. Date: Thu, 20 Oct 2016 12:13:33 -0400
  4. Subject: fix getopt_long_only misinterpreting "--" as an option
  5. ---
  6. src/misc/getopt_long.c | 2 +-
  7. 1 file changed, 1 insertion(+), 1 deletion(-)
  8. diff --git a/src/misc/getopt_long.c b/src/misc/getopt_long.c
  9. index 480c001..c6e1462 100644
  10. --- a/src/misc/getopt_long.c
  11. +++ b/src/misc/getopt_long.c
  12. @@ -53,7 +53,7 @@ static int __getopt_long_core(int argc, char *const *argv, const char *optstring
  13. {
  14. optarg = 0;
  15. if (longopts && argv[optind][0] == '-' &&
  16. - ((longonly && argv[optind][1]) ||
  17. + ((longonly && argv[optind][1] && argv[optind][1] != '-') ||
  18. (argv[optind][1] == '-' && argv[optind][2])))
  19. {
  20. int colon = optstring[optstring[0]=='+'||optstring[0]=='-']==':';
  21. --
  22. cgit v0.11.2