Index: head/sysutils/less/Makefile =================================================================== --- head/sysutils/less/Makefile (revision 408039) +++ head/sysutils/less/Makefile (revision 408040) @@ -1,36 +1,36 @@ # Created by: Andrey A. Chernov # $FreeBSD$ PORTNAME= less PORTVERSION= 458 CATEGORIES= sysutils MASTER_SITES= http://www.greenwoodsoftware.com/less/ \ - http://bitrote.org/distfiles/ + http://bitrote.org/distfiles/ MAINTAINER= jharris@widomaker.com COMMENT= Better pager utility LICENSE= GPLv3 -USES+= cpe +USES= cpe ncurses CPE_VENDOR= gnu GNU_CONFIGURE= yes PLIST_FILES= bin/less bin/lesskey bin/lessecho \ man/man1/less.1.gz man/man1/lesskey.1.gz \ man/man1/lessecho.1.gz OPTIONS_DEFINE= COLORS COLORS_DESC= Enable colors support via escape sequence .include .if ${PORT_OPTIONS:MCOLORS} CPPFLAGS+= -DCOLOR_LESS pre-fetch: @${ECHO_MSG} "Making a color version of less." .endif .include Index: head/sysutils/less/files/patch-Makefile.in =================================================================== --- head/sysutils/less/files/patch-Makefile.in (revision 408039) +++ head/sysutils/less/files/patch-Makefile.in (revision 408040) @@ -1,11 +1,11 @@ ---- Makefile.in.orig 2010/10/30 02:29:59 -+++ Makefile.in 2010/10/30 02:32:04 -@@ -17,7 +17,7 @@ +--- Makefile.in.orig 2013-04-04 16:55:06 UTC ++++ Makefile.in +@@ -17,7 +17,7 @@ CPPFLAGS = @CPPFLAGS@ EXEEXT = @EXEEXT@ O=o -LIBS = @LIBS@ -+LIBS = -ltermcap ++LIBS = -lncurses prefix = @prefix@ exec_prefix = @exec_prefix@ Index: head/sysutils/less/files/patch-charset.c =================================================================== --- head/sysutils/less/files/patch-charset.c (revision 408039) +++ head/sysutils/less/files/patch-charset.c (revision 408040) @@ -1,42 +1,42 @@ ---- charset.c.orig 2010/10/30 02:38:17 -+++ charset.c 2010/10/30 02:40:03 -@@ -408,6 +408,10 @@ +--- charset.c.orig 2013-04-04 16:55:05 UTC ++++ charset.c +@@ -407,6 +407,10 @@ binary_char(c) control_char(c) LWCHAR c; { +#ifdef COLOR_LESS + if (c == ESC) + return 0; +#endif c &= 0377; return (chardef[c] & IS_CONTROL_CHAR); } -@@ -423,6 +427,20 @@ +@@ -422,6 +426,20 @@ prchar(c) /* {{ This buffer can be overrun if LESSBINFMT is a long string. }} */ static char buf[32]; +#ifdef COLOR_LESS + if(c == ESC) + sprintf(buf, "%c", ESC); + else + { + c &= 0377; + if (!control_char(c)) + sprintf(buf, "%c", c); + else if (!control_char(c ^ 0100)) + sprintf(buf, "^%c", c ^ 0100); + else + sprintf(buf, binfmt, c); + } +#else c &= 0377; if ((c < 128 || !utf_mode) && !control_char(c)) SNPRINTF1(buf, sizeof(buf), "%c", (int) c); -@@ -446,6 +464,7 @@ +@@ -445,6 +463,7 @@ prchar(c) #endif else SNPRINTF1(buf, sizeof(buf), binfmt, c); +#endif return (buf); }