Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Jun 2001 13:50:04 -0700 (PDT)
From:      Sebastiaan van Erk <sebster@sebster.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/27972: losing information with talk
Message-ID:  <200106082050.f58Ko4342320@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/27972; it has been noted by GNATS.

From: Sebastiaan van Erk <sebster@sebster.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/27972: losing information with talk
Date: Fri, 8 Jun 2001 22:46:21 +0200

 Hi,
 
 I patched talk running at home with the following patch to flip the 
 "him" and "me" windows, tested it, and it semes to work.
 
 There also seems to be a bug in init_disp.c with the line (around line 104):
 
         idlok(my_win.x_win, TRUE);
 
 in the block where his_win is initialized... Shouldn't that read "his_win"?
 As is, the original code contains the above statement twice.
 
 Greetings,
 Sebastiaan van Erk
 
 ----------------------------------->8---------------------------------------
 
 diff -c -r talk.orig/init_disp.c talk/init_disp.c
 *** talk.orig/init_disp.c	Fri Jun  8 22:26:26 2001
 --- talk/init_disp.c	Fri Jun  8 22:26:00 2001
 ***************
 *** 90,111 ****
   	signal(SIGINT, sig_sent);
   	signal(SIGPIPE, sig_sent);
   	/* curses takes care of ^Z */
 ! 	my_win.x_nlines = LINES / 2;
   	my_win.x_ncols = COLS;
 ! 	my_win.x_win = newwin(my_win.x_nlines, my_win.x_ncols, 0, 0);
   	idlok(my_win.x_win, TRUE);
   	scrollok(my_win.x_win, TRUE);
   	wclear(my_win.x_win);
   
 ! 	his_win.x_nlines = LINES / 2 - 1;
   	his_win.x_ncols = COLS;
 ! 	his_win.x_win = newwin(his_win.x_nlines, his_win.x_ncols,
 ! 	    my_win.x_nlines+1, 0);
 ! 	idlok(my_win.x_win, TRUE);
   	scrollok(his_win.x_win, TRUE);
   	wclear(his_win.x_win);
   
 ! 	line_win = newwin(1, COLS, my_win.x_nlines, 0);
   #if defined(hline) || defined(whline) || defined(NCURSES_VERSION)
   	whline(line_win, 0, COLS);
   #else
 --- 90,111 ----
   	signal(SIGINT, sig_sent);
   	signal(SIGPIPE, sig_sent);
   	/* curses takes care of ^Z */
 ! 	my_win.x_nlines = LINES / 2 - 1;
   	my_win.x_ncols = COLS;
 ! 	my_win.x_win = newwin(my_win.x_nlines, my_win.x_ncols, 
 ! 	    his_win.x_nlines + 1, 0);
   	idlok(my_win.x_win, TRUE);
   	scrollok(my_win.x_win, TRUE);
   	wclear(my_win.x_win);
   
 ! 	his_win.x_nlines = LINES / 2;
   	his_win.x_ncols = COLS;
 ! 	his_win.x_win = newwin(his_win.x_nlines, his_win.x_ncols, 0, 0);
 ! 	idlok(his_win.x_win, TRUE);
   	scrollok(his_win.x_win, TRUE);
   	wclear(his_win.x_win);
   
 ! 	line_win = newwin(1, COLS, his_win.x_nlines, 0);
   #if defined(hline) || defined(whline) || defined(NCURSES_VERSION)
   	whline(line_win, 0, COLS);
   #else
 diff -c -r talk.orig/io.c talk/io.c
 *** talk.orig/io.c	Fri Jun  8 22:26:26 2001
 --- talk/io.c	Fri Jun  8 22:14:35 2001
 ***************
 *** 124,133 ****
   p_error(string)
   	char *string;
   {
 ! 	wmove(my_win.x_win, current_line, 0);
 ! 	wprintw(my_win.x_win, "[%s : %s (%d)]\n",
   	    string, strerror(errno), errno);
 ! 	wrefresh(my_win.x_win);
   	move(LINES-1, 0);
   	refresh();
   	quit();
 --- 124,133 ----
   p_error(string)
   	char *string;
   {
 ! 	wmove(his_win.x_win, current_line, 0);
 ! 	wprintw(his_win.x_win, "[%s : %s (%d)]\n",
   	    string, strerror(errno), errno);
 ! 	wrefresh(his_win.x_win);
   	move(LINES-1, 0);
   	refresh();
   	quit();
 ***************
 *** 140,148 ****
   message(string)
   	char *string;
   {
 ! 	wmove(my_win.x_win, current_line, 0);
 ! 	wprintw(my_win.x_win, "[%s]\n", string);
 ! 	if (current_line < my_win.x_nlines - 1)
   		current_line++;
 ! 	wrefresh(my_win.x_win);
   }
 --- 140,148 ----
   message(string)
   	char *string;
   {
 ! 	wmove(his_win.x_win, current_line, 0);
 ! 	wprintw(his_win.x_win, "[%s]\n", string);
 ! 	if (current_line < his_win.x_nlines - 1)
   		current_line++;
 ! 	wrefresh(his_win.x_win);
   }

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106082050.f58Ko4342320>