Subject: bin/636: tput args
To: None <gnats-admin@sun-lamp.cs.berkeley.edu>
From: None <sjg@zen.void.oz.au>
List: netbsd-bugs
Date: 12/11/1994 12:05:07
>Number: 636
>Category: bin
>Synopsis: tput cm args should be reversed for compatability with other *NIX
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people (Utility Bug People)
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sun Dec 11 12:05:04 1994
>Originator: Simon J. Gerraty
>Organization:
Simon J. Gerraty <sjg@zen.void.oz.au>
#include <disclaimer> /* imagine something _very_ witty here */
>Release: 1.0
>Environment:
System: NetBSD zen.void.oz.au 1.0 NetBSD 1.0 (ZEN) #5: Thu Dec 1 09:06:16 EST 1994 root@zen.void.oz.au:/e0/usr.src/sys/arch/i386/compile/ZEN i386
>Description:
tput reversing the order of row/col args to tput cm makes it
more compatable with SunOS,HP-UX,Solaris etc.
>How-To-Repeat:
I have a shell based menu system that runs on
SunOS,Solaris,HP-UX and many other UNIX systems, NetBSD's tput
has its row/col args for cursor positioning transposed as
compared to the other systems.
A simple fix (below) to tput makes more compatable with other *NIX.
>Fix:
Apply the following patch.
*** usr.bin/tput/tput.c~ Sat Mar 19 21:01:58 1994
--- usr.bin/tput/tput.c Sun Dec 11 18:06:01 1994
***************
*** 237,250 ****
(void)fprintf(stderr, errfew, 2, cap);
return NULL;
}
! arg_cols = atoi(*argv);
argv++;
if (!*argv || *argv[0] == '\0') {
(void)fprintf(stderr, errfew, 2, cap);
return NULL;
}
! arg_rows = atoi(*argv);
(void) tputs(tgoto(str, arg_cols, arg_rows), arg_rows, outc);
break;
--- 237,250 ----
(void)fprintf(stderr, errfew, 2, cap);
return NULL;
}
! arg_rows = atoi(*argv);
argv++;
if (!*argv || *argv[0] == '\0') {
(void)fprintf(stderr, errfew, 2, cap);
return NULL;
}
! arg_cols = atoi(*argv);
(void) tputs(tgoto(str, arg_cols, arg_rows), arg_rows, outc);
break;
>Audit-Trail:
>Unformatted: