termux-packages/packages/bvi/fix_errno.patch
ElTopo 35aecce3a3 add new package: redir (#772)
* add bvi package

* add new package: cgdb

* add gdb in cgdb's TERMUX_PKG_DEPENDS

* add new package: redir

* bvi package revision 1: fix column number issue with clang (gcc does not seem to have this issue)
bvi (compiled with clang) incorrectly displayed only 12 bytes for each line on a 80-column terminal (instead of 16 bytes normally). command :set cm=## also had similar problems.
I found the issue was caused by the following statements:
       sprintf(addr_form,  "%%0%dllX  ", AnzAdd);
       AnzAdd = sprintf(tmp, addr_form, block_begin);

	   ('block_begin''s data type is off_t)
	   gcc automatically typecasts 'block_begin' from off_t to loff_t,
	   on the otherhand, clang takes address of 'block_begin' and uses
	   it as loff_t thus writes some garbage value in 'tmp' string.
2017-02-20 22:14:52 +01:00

21 lines
573 B
Diff

--- bvi-1.4.0/bm_unix.c 2013-08-25 11:59:33.000000000 -0700
+++ src/bm_unix.c 2017-02-19 00:34:01.618869104 -0800
@@ -260,7 +260,6 @@
vgetc()
{
char cha;
- extern int errno;
errno = 0;
if (read(2, &cha, 1) <= 0) {
--- bvi-1.4.0/comm.c 2014-01-29 06:54:53.000000000 -0800
+++ src/comm.c 2017-02-19 00:34:01.622869129 -0800
@@ -84,7 +84,6 @@
extern char *name; /* actual filename */
extern char **files; /* used for "next" and "rewind" */
extern int numfiles, curfile;
-extern int errno;
static char oldbuf[CMDSZ]; /** for :!! command **/