From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Aug 16 21:50:12 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62B2F106568E for ; Sun, 16 Aug 2009 21:50:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3F56C8FC51 for ; Sun, 16 Aug 2009 21:50:12 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n7GLoCAb012407 for ; Sun, 16 Aug 2009 21:50:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n7GLoCjF012406; Sun, 16 Aug 2009 21:50:12 GMT (envelope-from gnats) Resent-Date: Sun, 16 Aug 2009 21:50:12 GMT Resent-Message-Id: <200908162150.n7GLoCjF012406@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Hung-Yi Chen Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 602A0106564A for ; Sun, 16 Aug 2009 21:49:40 +0000 (UTC) (envelope-from gaod@gaod.tfcis.org) Received: from gaod.tfcis.org (gaod.tfcis.org [210.70.137.25]) by mx1.freebsd.org (Postfix) with SMTP id B08968FC3D for ; Sun, 16 Aug 2009 21:49:39 +0000 (UTC) Received: from gaod.tfcis.org (localhost [127.0.0.1]) by gaod.tfcis.org (Postfix) with ESMTP id A92658FC1D for ; Mon, 17 Aug 2009 05:44:52 +0800 (CST) Received: (from root@localhost) by gaod.tfcis.org (8.14.3/8.14.3/Submit) id n7GLiqSs088585; Mon, 17 Aug 2009 05:44:52 +0800 (CST) (envelope-from gaod) Message-Id: <200908162144.n7GLiqSs088585@gaod.tfcis.org> Date: Mon, 17 Aug 2009 05:44:52 +0800 (CST) From: Hung-Yi Chen To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/137858: [PATCH] chinese/ve: fix terminal initial problem X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Hung-Yi Chen List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2009 21:50:12 -0000 >Number: 137858 >Category: ports >Synopsis: [PATCH] chinese/ve: fix terminal initial problem >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Aug 16 21:50:10 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Hung-Yi Chen >Release: FreeBSD 7.2-RELEASE-p3 i386 >Organization: >Environment: System: FreeBSD gaod.tfcis.org 7.2-RELEASE-p3 FreeBSD 7.2-RELEASE-p3 #3: Sat Aug 1 22:21:07 CST 2009 gaod@gaod.tfcis.org:/usr/obj/usr/src/sys/gaod i386 >Description: Fix the terminal initial problem with color redraw. >How-To-Repeat: >Fix: Apply the following path: --- ve begins here --- ===> Generating patch ===> Viewing diff with more diff -ruN --exclude=CVS /usr/ports/chinese/ve.orig/Makefile /usr/ports/chinese/ve/Makefile --- /usr/ports/chinese/ve.orig/Makefile 2009-01-06 01:27:25.000000000 +0800 +++ /usr/ports/chinese/ve/Makefile 2009-08-17 05:42:47.000000000 +0800 @@ -7,7 +7,7 @@ PORTNAME= ve PORTVERSION= 1.0 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= chinese MASTER_SITES= LOCAL/chinsan EXTRACT_SUFX= .tgz diff -ruN --exclude=CVS /usr/ports/chinese/ve.orig/files/patch-Makefile /usr/ports/chinese/ve/files/patch-Makefile --- /usr/ports/chinese/ve.orig/files/patch-Makefile 2006-03-21 05:58:01.000000000 +0800 +++ /usr/ports/chinese/ve/files/patch-Makefile 2009-08-17 05:37:14.000000000 +0800 @@ -1,5 +1,5 @@ ---- Makefile.orig Wed Aug 25 14:27:23 1999 -+++ Makefile Thu Dec 18 01:29:56 2003 +--- Makefile.orig 2009-08-17 05:35:44.000000000 +0800 ++++ Makefile 2009-08-17 05:37:07.000000000 +0800 @@ -1,10 +1,11 @@ -CC = gcc +CC ?= cc @@ -14,14 +14,12 @@ LIBS = -ltermcap -lcompat #---------------------------------------------------------- -@@ -26,12 +27,12 @@ - rm -f *.o ve entab +@@ -27,11 +28,11 @@ install: all -- mkdir -p /usr/local/share/ve + mkdir -p /usr/local/share/ve - cp ve /usr/local/bin - cp 00readme.txt ve.hlp /usr/local/share/ve -+ mkdir -p $(PREFIX)/share/ve + $(BSD_INSTALL_PROGRAM) ve $(PREFIX)/bin + $(BSD_INSTALL_DATA) 00readme.txt ve.hlp $(PREFIX)/share/ve diff -ruN --exclude=CVS /usr/ports/chinese/ve.orig/files/patch-bbs.h /usr/ports/chinese/ve/files/patch-bbs.h --- /usr/ports/chinese/ve.orig/files/patch-bbs.h 2008-05-01 22:08:18.000000000 +0800 +++ /usr/ports/chinese/ve/files/patch-bbs.h 2009-08-17 05:38:55.000000000 +0800 @@ -1,9 +1,18 @@ ---- bbs.h.orig 2008-05-01 19:32:07.000000000 +0800 -+++ bbs.h 2008-05-01 19:45:36.000000000 +0800 -@@ -25,14 +25,6 @@ +--- bbs.h.orig 2009-08-17 05:38:33.000000000 +0800 ++++ bbs.h 2009-08-17 05:38:47.000000000 +0800 +@@ -12,6 +12,7 @@ + #define BIT8 + + #include ++#include + #include + #include + #include +@@ -24,14 +25,7 @@ + #include #include #include - +- - -#ifdef LINUX -#include @@ -11,7 +20,7 @@ -#include -#endif - -- ++#include + #ifdef SYSV - #ifndef LOCK_EX diff -ruN --exclude=CVS /usr/ports/chinese/ve.orig/files/patch-edit.c /usr/ports/chinese/ve/files/patch-edit.c --- /usr/ports/chinese/ve.orig/files/patch-edit.c 1970-01-01 08:00:00.000000000 +0800 +++ /usr/ports/chinese/ve/files/patch-edit.c 2009-08-17 05:40:13.000000000 +0800 @@ -0,0 +1,10 @@ +--- edit.c.orig 2009-08-17 05:39:58.000000000 +0800 ++++ edit.c 2009-08-17 05:40:01.000000000 +0800 +@@ -6,7 +6,6 @@ + /* update : 95/12/15 */ + /*-------------------------------------------------------*/ + +-#include + #include + #include "bbs.h" + diff -ruN --exclude=CVS /usr/ports/chinese/ve.orig/files/patch-editor.c /usr/ports/chinese/ve/files/patch-editor.c --- /usr/ports/chinese/ve.orig/files/patch-editor.c 2009-01-02 16:06:15.000000000 +0800 +++ /usr/ports/chinese/ve/files/patch-editor.c 1970-01-01 08:00:00.000000000 +0800 @@ -1,10 +0,0 @@ ---- editor.c.orig 2008-12-21 22:42:24.000000000 +0800 -+++ editor.c 2008-12-21 22:42:35.000000000 +0800 -@@ -21,6 +21,7 @@ - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -+#include - #include "bbs.h" - - #define gtty(fd,data) tcgetattr(fd,data) diff -ruN --exclude=CVS /usr/ports/chinese/ve.orig/files/patch-screen.c /usr/ports/chinese/ve/files/patch-screen.c --- /usr/ports/chinese/ve.orig/files/patch-screen.c 2009-01-06 01:27:25.000000000 +0800 +++ /usr/ports/chinese/ve/files/patch-screen.c 2009-08-17 05:41:07.000000000 +0800 @@ -1,16 +1,15 @@ ---- screen.c_orig 2008-12-21 22:41:24.000000000 +0800 -+++ screen.c 2008-12-21 22:41:40.000000000 +0800 -@@ -6,7 +6,8 @@ +--- screen.c.orig 1996-11-24 23:45:45.000000000 +0800 ++++ screen.c 2009-08-17 05:34:03.000000000 +0800 +@@ -6,7 +6,7 @@ /* update : 95/12/15 */ /*-------------------------------------------------------*/ -#include +#include -+#include #include "bbs.h" extern char clearbuf[]; -@@ -46,8 +47,6 @@ +@@ -46,8 +46,6 @@ { if (!dumb_term && !big_picture) { @@ -19,7 +18,7 @@ scr_lns = t_lines; scr_cols = t_columns = ANSILINELEN; /* scr_cols = MIN(t_columns, ANSILINELEN); */ -@@ -601,13 +600,12 @@ +@@ -601,14 +599,12 @@ void @@ -32,7 +31,8 @@ + char buff[512]; - va_start(args); +- fmt = va_arg(args, char *); + va_start(args, fmt); - fmt = va_arg(args, char *); vsprintf(buff, fmt, args); va_end(args); + outs(buff); diff -ruN --exclude=CVS /usr/ports/chinese/ve.orig/files/patch-term.c /usr/ports/chinese/ve/files/patch-term.c --- /usr/ports/chinese/ve.orig/files/patch-term.c 2008-05-07 05:49:59.000000000 +0800 +++ /usr/ports/chinese/ve/files/patch-term.c 2009-08-17 05:41:45.000000000 +0800 @@ -1,27 +1,24 @@ ---- term.c.orig 2008-05-01 19:34:15.000000000 +0800 -+++ term.c 2008-05-01 19:44:06.000000000 +0800 -@@ -9,17 +9,16 @@ - +--- term.c.orig 1997-01-25 00:36:57.000000000 +0800 ++++ term.c 2009-08-17 05:34:15.000000000 +0800 +@@ -10,17 +10,6 @@ #include "bbs.h" #include -+#include - - #ifdef HP_UX - #define O_HUPCL 01 - #define O_XTABS 02 - #endif +-#ifdef HP_UX +-#define O_HUPCL 01 +-#define O_XTABS 02 +-#endif +- -#ifdef LINUX -#include -#define stty(fd, data) tcsetattr( fd, TCSETS, data ) -+#include -+#define stty(fd, data) tcsetattr( fd, TCSANOW, data ) - #define gtty(fd, data) tcgetattr( fd, data ) +-#define gtty(fd, data) tcgetattr( fd, data ) -#endif - +- #ifndef TANDEM #define TANDEM 0x00000001 -@@ -29,11 +28,7 @@ + #endif +@@ -29,11 +18,7 @@ #define CBREAK 0x00000002 #endif @@ -33,7 +30,28 @@ /* ----------------------------------------------------- */ -@@ -62,37 +57,11 @@ +@@ -44,55 +29,47 @@ + void + get_tty() + { +- if (gtty (1, &tty_state) < 0) ++ if (tcgetattr(1, &tty_state) < 0) + { + fprintf (stderr, "gtty failed\n"); + exit (-1); + } + } + +- ++#if 0 + void + init_tty() + { +- if (gtty(1, &tty_state) < 0) ++ if (tcgetattr(1, &tty_state) < 0) + { + fprintf(stderr, "gtty failed\n"); + exit(-1); } memcpy(&tty_new, &tty_state, sizeof(tty_new)); @@ -55,7 +73,24 @@ - + tty_new.c_lflag &= ~(ICANON | ECHO | ISIG); stty(1, &tty_new); --#endif ++} + #endif ++void ++init_tty(void) ++{ ++ struct termios tty_state, tty_new; ++ ++ if (tcgetattr(1, &tty_state) < 0) { ++ fprintf(stderr, "tcgetattr(): %m"); ++ return; ++ } ++ memcpy(&tty_new, &tty_state, sizeof(tty_new)); ++ tty_new.c_lflag &= ~(ICANON | ECHO | ISIG); ++ /* ++ * tty_new.c_cc[VTIME] = 0; tty_new.c_cc[VMIN] = 1; ++ */ ++ tcsetattr(1, TCSANOW, &tty_new); ++ system("stty raw -echo"); } @@ -72,16 +107,17 @@ void reset_tty() { -@@ -104,8 +73,6 @@ +@@ -104,9 +81,6 @@ stty(1, &tty_new); } -#endif - - +- /* ----------------------------------------------------- */ -@@ -171,11 +138,7 @@ + /* init tty control code */ +@@ -171,11 +145,7 @@ char *sbp, *s; char *tgetstr(); ===> Done --- ve ends here --- >Release-Note: >Audit-Trail: >Unformatted: