The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / uclibc / 0.9.33.2 / 0033-rpmatch-backport-function.patch
1 From 929b1a121c5ff0daa33b2107b4c1a68b650d93ee Mon Sep 17 00:00:00 2001
2 From: Mike Frysinger <vapier@gentoo.org>
3 Date: Mon, 30 Apr 2012 00:40:49 -0400
4 Subject: [PATCH] rpmatch: backport function
5
6 rpmatch will match ^[Yy] and ^[Nn] regardless of locale
7
8 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
9 Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
10 ---
11  include/stdlib.h        |    2 +-
12  libc/stdlib/Makefile.in |    2 +-
13  libc/stdlib/rpmatch.c   |    7 +++++++
14  libc/stdlib/stdlib.c    |    8 ++++++++
15  4 files changed, 17 insertions(+), 2 deletions(-)
16  create mode 100644 libc/stdlib/rpmatch.c
17
18 diff --git a/include/stdlib.h b/include/stdlib.h
19 index 4aa1227..42b585c 100644
20 --- a/include/stdlib.h
21 +++ b/include/stdlib.h
22 @@ -851,7 +851,7 @@ __END_NAMESPACE_STD
23  #endif /* __UCLIBC_HAS_WCHAR__ */
24  
25  
26 -#if 0 /*def __USE_SVID*/
27 +#ifdef __USE_SVID
28  /* Determine whether the string value of RESPONSE matches the affirmation
29     or negative response expression as specified by the LC_MESSAGES category
30     in the program's current locale.  Returns 1 if affirmative, 0 if
31 diff --git a/libc/stdlib/Makefile.in b/libc/stdlib/Makefile.in
32 index f219d21..e802441 100644
33 --- a/libc/stdlib/Makefile.in
34 +++ b/libc/stdlib/Makefile.in
35 @@ -33,7 +33,7 @@ endif
36  
37  # multi source stdlib.c
38  CSRC-y += abs.c labs.c atoi.c atol.c strtol.c strtoul.c _stdlib_strto_l.c \
39 -       qsort.c qsort_r.c bsearch.c \
40 +       qsort.c qsort_r.c bsearch.c rpmatch.c \
41         llabs.c atoll.c strtoll.c strtoull.c _stdlib_strto_ll.c
42  # (aliases) strtoq.o strtouq.o
43  CSRC-$(UCLIBC_HAS_FLOATS) += atof.c
44 diff --git a/libc/stdlib/rpmatch.c b/libc/stdlib/rpmatch.c
45 new file mode 100644
46 index 0000000..dce06b6
47 --- /dev/null
48 +++ b/libc/stdlib/rpmatch.c
49 @@ -0,0 +1,7 @@
50 +/* Copyright (C) 2012 Bernhard Reutner-Fischer <uclibc@uclibc.org>
51 + *
52 + * Licensed under the LGPL v2.1+, see the file COPYING.LIB in this tarball.
53 + */
54 +
55 +#define L_rpmatch
56 +#include "stdlib.c"
57 diff --git a/libc/stdlib/stdlib.c b/libc/stdlib/stdlib.c
58 index 9e8c347..de8f084 100644
59 --- a/libc/stdlib/stdlib.c
60 +++ b/libc/stdlib/stdlib.c
61 @@ -318,6 +318,14 @@ long long atoll(const char *nptr)
62  
63  #endif
64  /**********************************************************************/
65 +#ifdef L_rpmatch
66 +int rpmatch (__const char *__response)
67 +{
68 +       return (__response[0] == 'y' || __response[0] == 'Y') ? 1 :
69 +               (__response[0] == 'n' || __response[0] == 'N') ? 0 : -1;
70 +}
71 +#endif
72 +/**********************************************************************/
73  #if defined(L_strtol) || defined(L_strtol_l)
74  
75  libc_hidden_proto(__XL_NPP(strtol))
76 -- 
77 1.7.10.4
78