1 static char Sccsid[] = "@(#)trnslat.c 1.2 02/15/87"; 2 /* 3 Copy `str' to `result' replacing any character found 4 in both `str' and `old' with the corresponding character from `new'. 5 Return `result'. 6 */ 7 8 char *trnslat(str,old,new,result) 9 register char *str; 10 char *old, *new, *result; 11 { 12 register char *r, *o; 13 14 for (r = result; *r = *str++; r++) 15 for (o = old; *o; ) 16 if (*r == *o++) { 17 *r = new[o - old -1]; 18 break; 19 } 20 return(result); 21 } 22