Package-Name: bpe
Gentoo-Package: app-editors/bpe
Requires: ncurses|ncurses4
Source: ibibliolinux:///utils/file/hex/bpe-(\d+.\d+(.\d+)?).tar.gz $1
Zap-Before-Install: 1
Repack:
	tar xzvfp "$(SOURCE)"
Compile:
	cp -pf readme* "$(PREFIX)/"
	rm -f *.o
	$(MAKE) LOCAL="-O2 -I/usr/include/ncurses" LIBES="-lncurses" NKEYPAD=""
	umask 022 ; mkdir -p "$(PREFIX)"/{bin,man/man1}
	cp -pf bpe "$(PREFIX)"/bin/
	cp -pf bpe.1 "$(PREFIX)"/man/man1/
Install:
	$(MAKE) instbin BIN=bpe
	$(MAKE) instman SECTION=1 MAN=bpe
Patch: <<EOT
--- readme.old	2003-12-12 22:08:19 +0900
+++ readme	2006-09-18 02:58:50 +0900
@@ -115,3 +115,14 @@
 - Moved old versions of the source into `old/'.
 
 	Andrew Church <achurch@achurch.org> 2003/12/12
+
+----------------------------------------------------------------
+
+Version 1.6 changes:
+
+- Fixed a bug in `H' where the search would fail if the first byte was
+  between 0x80 and 0xFF inclusive.
+
+- Cleaned up some comments.
+
+	Andrew Church <achurch@achurch.org> 2006/09/18
--- hexsrch.c.old	2003-12-04 22:24:04 +0900
+++ hexsrch.c	2006-09-18 02:54:56 +0900
@@ -10,7 +10,7 @@
 ** hex_2_byte returns the integer value of a byte
 ** represented by the two characters passed to it.
 ** For example, passed an '8' and an 'A', it will
-** return 170 (8 * 16 + 10).  Returns -1 on any error.
+** return 138 (8 * 16 + 10).  Returns -1 on any error.
 */
 
 int
@@ -119,7 +119,7 @@
 	searchpos = (filpos == old_filpos ? re_search : 0);
 	while (found == 0) {
 		while ((256 - searchpos) >= stlen) {
-			if (secbuf[searchpos] != hexstr[0] || memcmp(secbuf + searchpos + 1, hexstr + 1, stlen - 1))
+			if (((int)secbuf[searchpos] & 0xFF) != ((int)hexstr[0] & 0xFF) || memcmp(secbuf + searchpos + 1, hexstr + 1, stlen - 1))
 				searchpos++;
 			else {
 				filpos += searchpos;
EOT

/pkg/bpe/
/usr/bin/bpe
/usr/man/man1/bpe.1.gz
