live-bootstrap/steps/flex-2.5.11/patches/yyin.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

43 lines
1.3 KiB
Diff

SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
SPDX-FileCopyrightText: 2019-2020 Giovanni Mascellani <gio@debian.org>
SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: BSD-2-Clause
yyin has an odd redefinition error in scan.l, so we ensure that we don't
acidentally re-declare it.
diff --git flexdef.h flexdef.h
index 3eb710a..94ef024 100644
--- flex-2.5.11/flexdef.h
+++ flex-2.5.11/flexdef.h
@@ -421,7 +421,7 @@ extern int yymore_really_used, reject_really_used;
*/
extern int datapos, dataline, linenum, out_linenum;
-extern FILE *skelfile, *yyin, *backing_up_file;
+extern FILE *skelfile, *backing_up_file;
extern const char *skel[];
extern int skel_ind;
extern char *infilename, *outfilename, *headerfilename;
@@ -432,6 +432,10 @@ extern char **input_files;
extern int num_input_files;
extern char *program_name;
+#ifndef yyin_defined
+extern FILE* yyin;
+#endif
+
extern char *action_array;
extern int action_size;
extern int defs1_offset, prolog_offset, action_offset, action_index;
--- flex-2.5.11/scan.l
+++ flex-2.5.11/scan.l
@@ -32,6 +32,7 @@
/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
/* PURPOSE. */
+#define yyin_defined
#include "flexdef.h"
#include "parse.h"