2fcd5f182261071395a268fbca1ed02ee5f5cd5a
[openwrt/openwrt.git] / toolchain / musl / patches / 002-fix-getsubopt.patch
1 From 2a502f995d041977f43f05556a3beba64df69858 Mon Sep 17 00:00:00 2001
2 From: Steven Barth <cyrus@openwrt.org>
3 Date: Tue, 18 Aug 2015 11:03:45 +0200
4 Subject: [PATCH] getsubopt: don't include leading = in value string
5
6 getsubopt incorrectly returns the delimiting = in the value string,
7 this patch fixes it by increasing the pointer position by one.
8
9 Signed-off-by: Steven Barth <cyrus@openwrt.org>
10 ---
11 src/misc/getsubopt.c | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14 diff --git a/src/misc/getsubopt.c b/src/misc/getsubopt.c
15 index dac9bf9..53ee957 100644
16 --- a/src/misc/getsubopt.c
17 +++ b/src/misc/getsubopt.c
18 @@ -15,7 +15,7 @@ int getsubopt(char **opt, char *const *keys, char **val)
19 size_t l = strlen(keys[i]);
20 if (strncmp(keys[i], s, l)) continue;
21 if (s[l] == '=')
22 - *val = s + l;
23 + *val = s + l + 1;
24 else if (s[l]) continue;
25 return i;
26 }
27 --
28 2.1.4
29