From owner-freebsd-bugs@FreeBSD.ORG Sat Jul 16 10:00:32 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 697B316A41C for ; Sat, 16 Jul 2005 10:00:32 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E64A143D46 for ; Sat, 16 Jul 2005 10:00:31 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j6GA0VmY001463 for ; Sat, 16 Jul 2005 10:00:31 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j6GA0Vdl001461; Sat, 16 Jul 2005 10:00:31 GMT (envelope-from gnats) Resent-Date: Sat, 16 Jul 2005 10:00:31 GMT Resent-Message-Id: <200507161000.j6GA0Vdl001461@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dan Lukes Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0F5C316A41C for ; Sat, 16 Jul 2005 09:56:52 +0000 (GMT) (envelope-from dan@kulesh.obluda.cz) Received: from kulesh.obluda.cz (kulesh.obluda.cz [193.179.22.243]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD61A43D45 for ; Sat, 16 Jul 2005 09:56:50 +0000 (GMT) (envelope-from dan@kulesh.obluda.cz) Received: from kulesh.obluda.cz (localhost.eunet.cz [127.0.0.1]) by kulesh.obluda.cz (8.13.4/8.13.4) with ESMTP id j6G9umvO053419 for ; Sat, 16 Jul 2005 11:56:48 +0200 (CEST) (envelope-from dan@kulesh.obluda.cz) Received: (from root@localhost) by kulesh.obluda.cz (8.13.4/8.13.1/Submit) id j6G9ulKJ053415; Sat, 16 Jul 2005 11:56:47 +0200 (CEST) (envelope-from dan) Message-Id: <200507160956.j6G9ulKJ053415@kulesh.obluda.cz> Date: Sat, 16 Jul 2005 11:56:47 +0200 (CEST) From: Dan Lukes To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/83553: [ PATCH ] vidcontrol can't switch mode and color during one X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Dan Lukes List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jul 2005 10:00:32 -0000 >Number: 83553 >Category: bin >Synopsis: [ PATCH ] vidcontrol can't switch mode and color during one >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jul 16 10:00:31 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Dan Lukes >Release: FreeBSD 6.0-BETA1 i386 >Organization: Obludarium >Environment: System: FreeBSD 6.0-BETA1 #0: Sat Jul 16 00:42:20 CEST 2005 i386 >Description: vidcontrol didn't change colors when video mode change requested It's because get_{normal|reverse}_color()/set_colors() logic is broken Original get_*_color() functions set color immediatelly, doesn't store color codes into {normal|reverse}_{fore|back}_color variables nor raising value of colors_changed Unfortunatelly, on the end of program run, when mode changed, the set_color() has been called. It set colors to {normal|reverse}_{fore|back}_color as obtained during initialization (e.g. it set's back original colors) Note, the colors_changed variable isn't changed within code anywhere. It's clear sign the thinks are broken somewhat. >How-To-Repeat: run 'vidcontrol ' mode changes, color remain unchanged >Fix: get_{normal|reverse}_color() store obtained colors into {normal|reverse}_{fore|back}_color variables and sets colors_changed to 1 On end of run the set_color() process changes as requested. Please note the get_{normal|reverse}_color() still apply changes immediatelly also. It's for backward compatibility. Original code allow the vidcontrol call with ' ' (althought the manual page mention the reverse order only). The order is important during background color changes. --- patch begins here --- --- usr.sbin/vidcontrol/vidcontrol.c.ORIG Fri Jul 15 17:03:40 2005 +++ usr.sbin/vidcontrol/vidcontrol.c Sat Jul 16 10:47:44 2005 @@ -715,11 +715,14 @@ if (*_index < argc && (color = get_color_number(argv[*_index])) != -1) { (*_index)++; fprintf(stderr, "\033[=%dF", color); + normal_fore_color=color; + colors_changed = 1; if (*_index < argc && (color = get_color_number(argv[*_index])) != -1 && color < 8) { (*_index)++; fprintf(stderr, "\033[=%dG", color); + normal_back_color=color; } } } @@ -736,11 +739,14 @@ if ((color = get_color_number(argv[*(_index)-1])) != -1) { fprintf(stderr, "\033[=%dH", color); + revers_fore_color=color; + colors_changed = 1; if (*_index < argc && (color = get_color_number(argv[*_index])) != -1 && color < 8) { (*_index)++; fprintf(stderr, "\033[=%dI", color); + revers_back_color=color; } } } --- patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: run