date and time created 88/07/21 17:35:50 by marc
[unix-history] / usr / src / local / sccscmds / sccscmds.ok / util / trnslat.c
CommitLineData
7c9c5d18 1static char Sccsid[] = "@(#)trnslat.c 1.2 %G%";
aaaa7398
JL
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
8char *trnslat(str,old,new,result)
9register char *str;
10char *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}