summaryrefslogtreecommitdiffstats
path: root/usr.bin/patch/common.h
diff options
context:
space:
mode:
authorjca <jca@openbsd.org>2019-12-02 22:17:32 +0000
committerjca <jca@openbsd.org>2019-12-02 22:17:32 +0000
commit5fbd5e42b6e8a8eb350fdd243f46cfefbc9d0b49 (patch)
treeec65908650d1ed62a7b684ae63306187b0056102 /usr.bin/patch/common.h
parentthe dhcp6 printing doesn't need these files anymore. (diff)
downloadwireguard-openbsd-5fbd5e42b6e8a8eb350fdd243f46cfefbc9d0b49.tar.xz
wireguard-openbsd-5fbd5e42b6e8a8eb350fdd243f46cfefbc9d0b49.zip
Use getline(3) to handle lines longer than 8192 bytes in patch files
Spotted by jsg@ when working on mesa. Diff tested by sthen@ in a partial i386 bulk. Input from and ok jsg@ millert@
Diffstat (limited to 'usr.bin/patch/common.h')
-rw-r--r--usr.bin/patch/common.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/patch/common.h b/usr.bin/patch/common.h
index 78b9b0d047a..8165d5b4bb2 100644
--- a/usr.bin/patch/common.h
+++ b/usr.bin/patch/common.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: common.h,v 1.29 2015/07/26 14:32:19 millert Exp $ */
+/* $OpenBSD: common.h,v 1.30 2019/12/02 22:17:32 jca Exp $ */
/*
* patch - a program to apply diffs to original files
@@ -37,7 +37,7 @@
#define MAXHUNKSIZE 100000 /* is this enough lines? */
#define INITHUNKMAX 125 /* initial dynamic allocation size */
-#define MAXLINELEN 8192
+#define INITLINELEN 8192
#define BUFFERSIZE 1024
#define LINENUM_MAX LONG_MAX
@@ -59,7 +59,8 @@ typedef long LINENUM; /* must be signed */
extern mode_t filemode;
-extern char buf[MAXLINELEN];/* general purpose buffer */
+extern char *buf; /* general purpose buffer */
+extern size_t bufsz; /* general purpose buffer size */
extern bool using_plan_a; /* try to keep everything in memory */
extern bool out_of_mem; /* ran out of memory in plan a */