diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-01-11 18:25:23 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-01-11 18:25:23 +0000 |
commit | 67ea433a97e7821ad489f31af0b2e087144b5617 (patch) | |
tree | c69ba4cc8b1334ffe962061fb8442325c5e674b8 /toolchain/musl/patches/120-getopt_non-option-arguments_fix.patch | |
parent | 1a59c96060116d50073cd2f236c6175e1c05e185 (diff) | |
download | upstream-67ea433a97e7821ad489f31af0b2e087144b5617.tar.gz upstream-67ea433a97e7821ad489f31af0b2e087144b5617.tar.bz2 upstream-67ea433a97e7821ad489f31af0b2e087144b5617.zip |
musl: merge changes from git, includes further getopt fixes
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43939 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'toolchain/musl/patches/120-getopt_non-option-arguments_fix.patch')
-rw-r--r-- | toolchain/musl/patches/120-getopt_non-option-arguments_fix.patch | 43 |
1 files changed, 0 insertions, 43 deletions
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])) - { |