Subject: tput cm
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: Simon J. Gerraty <sjg@zen.void.oz.au>
List: current-users
Date: 01/19/1994 23:51:45
The following patch adds a call to tgoto() for tput cm (and even tput
cup).  I needed this for some fancy shell scripts that work very
nicely on other systems...

*** tput.c~	Sun Nov  7 21:15:41 1993
--- tput.c	Wed Jan 19 23:48:06 1994
***************
*** 83,88 ****
--- 83,90 ----
  		case 'c':
  			if (!strcmp(p, "clear"))
  				p = "cl";
+ 			else if (!strcmp(p, "cup"))
+ 				p = "cm";
  			break;
  		case 'i':
  			if (!strcmp(p, "init"))
***************
*** 97,105 ****
  				p = "rs";
  			break;
  		}
! 		if (tgetstr(p, &cptr))
! 			(void)tputs(buf, 1, outc);
! 		else if ((n = tgetnum(p)) != -1)
  			(void)printf("%d\n", n);
  		else
  			exitval = !tgetflag(p);
--- 99,114 ----
  				p = "rs";
  			break;
  		}
! 		if (tgetstr(p, &cptr)) {
! 			if (!strcmp(p, "cm")) {
! 				if (argc < 3) {
! 					(void)fprintf(stderr, "tput: cm row col\n");
! 					exit(2);
! 				}
! 				(void)printf("%s", tgoto(buf, atoi(argv[2]), atoi(argv[1])));
! 			} else 
! 				(void)tputs(buf, 1, outc);
! 		} else if ((n = tgetnum(p)) != -1)
  			(void)printf("%d\n", n);
  		else
  			exitval = !tgetflag(p);


------------------------------------------------------------------------------