From 63176d7e1ed8817b9219e24caa6182dc2acb77e8 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 11 Jan 2015 18:25:23 +0000 Subject: musl: merge changes from git, includes further getopt fixes Signed-off-by: Felix Fietkau SVN-Revision: 43939 --- .../120-getopt_non-option-arguments_fix.patch | 43 ---------------------- 1 file changed, 43 deletions(-) delete mode 100644 toolchain/musl/patches/120-getopt_non-option-arguments_fix.patch (limited to 'toolchain/musl/patches/120-getopt_non-option-arguments_fix.patch') diff --git a/toolchain/musl/patches/120-getopt_non-option-arguments_fix.patch b/toolchain/musl/patches/120-getopt_non-option-arguments_fix.patch deleted file mode 100644 index 3cd909da46..0000000000 --- a/toolchain/musl/patches/120-getopt_non-option-arguments_fix.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- a/src/misc/getopt.c -+++ b/src/misc/getopt.c -@@ -24,8 +24,23 @@ int getopt(int argc, char * const argv[] - optind = 1; - } - -- if (optind >= argc || !argv[optind] || argv[optind][0] != '-' || !argv[optind][1]) -+ if (optind >= argc || !argv[optind]) - return -1; -+ -+ if (argv[optind][0] != '-') { -+ /* GNU extension */ -+ if (optstring[0] == '-') { -+ optarg = argv[optind]; -+ optind++; -+ return 1; -+ } -+ -+ return -1; -+ } -+ -+ if (!argv[optind][1]) -+ return -1; -+ - if (argv[optind][1] == '-' && !argv[optind][2]) - return optind++, -1; - ---- a/src/misc/getopt_long.c -+++ b/src/misc/getopt_long.c -@@ -12,7 +12,12 @@ static int __getopt_long(int argc, char - __optpos = 0; - optind = 1; - } -- if (optind >= argc || !argv[optind] || argv[optind][0] != '-') return -1; -+ if (optind >= argc || !argv[optind]) -+ return -1; -+ -+ if (argv[optind][0] != '-') -+ return getopt(argc, argv, optstring); -+ - if ((longonly && argv[optind][1]) || - (argv[optind][1] == '-' && argv[optind][2])) - { -- cgit v1.2.3