live-bootstrap/steps/coreutils-5.0/patches/mbstate.patch
fosslinux a67db8fcbd Make patches relative to where tarballs are extracted
Ever since an old patch version, it has (for reasonable security
reasons) not supported patched with ../ in the filename.
Many of our patches have been relying on this behaviour being OK,
because we start off with an ancient patch version that didn't perform
such checks. As soon as we need this behaviour after we build a newer
patch though, we will have problems.

So, let's change the policy.
Patches are relative to where tarballs are extracted, rather than the
"working directory" - e.g. have patches for `coreutils-9.4/src/cp.c`
instead of `src/cp.c`.
Keeping this consistent has a few implications;
- patches are applied from the build/ directory in bash era now, with
  `-p0`
- when patches are manually applied in the bash era, use `-p` as
  required, usually `-p1`
- in kaem era where patches are always manually applied, `-p1` is used
2024-12-23 15:20:42 +11:00

44 lines
1.3 KiB
Diff

SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: GPL-2.0-or-later
mbstate_t is a struct that is required. However, it is not defined by mes libc.
This implementation was taken from glibc 2.32.
--- coreutils-5.0/lib/quotearg.c 2002-11-23 07:08:10.000000000 +0000
+++ coreutils-5.0/lib/quotearg.c 2021-01-17 19:41:59.461095532 +0000
@@ -21,6 +21,7 @@
# include <config.h>
#endif
+#include "mbstate_t.h"
#include "quotearg.h"
#include "xalloc.h"
--- coreutils-5.0/lib/mbstate_t.h 1970-01-01 01:00:00.000000000 +0100
+++ coreutils-5.0/lib/mbstate_t.h 2021-01-17 19:42:21.341658668 +0000
@@ -0,0 +1,23 @@
+#ifndef ____mbstate_t_defined
+#define ____mbstate_t_defined 1
+
+/* Integral type unchanged by default argument promotions that can
+ hold any value corresponding to members of the extended character
+ set, as well as at least one value that does not correspond to any
+ member of the extended character set. */
+#ifndef __WINT_TYPE__
+# define __WINT_TYPE__ unsigned int
+#endif
+
+/* Conversion state information. */
+typedef struct
+{
+ int __count;
+ union
+ {
+ __WINT_TYPE__ __wch;
+ char __wchb[4];
+ } __value; /* Value so far. */
+} mbstate_t;
+
+#endif