|
|
1.1 root 1: # include <ingres.h>
2: # include <sccs.h>
3:
4: SCCSID(@(#)trim_relna.c 7.1 2/5/81)
5:
6: /*
7: ** TRIM_RELNM -- trim blanks from relation name for printing
8: **
9: ** A relation name (presumably in 'ingresname' format: MAXNAME
10: ** characters long with no terminating null byte) has the
11: ** trailing blanks trimmed off of it into a local buffer, so
12: ** that it can be printed neatly.
13: **
14: ** Parameters:
15: ** name -- a pointer to the relation name
16: **
17: ** Returns:
18: ** a pointer to the trimmed relation name.
19: **
20: ** Side Effects:
21: ** none
22: */
23:
24: char *
25: trim_relname(name)
26: char *name;
27: {
28: register char *old, *new;
29: register int i;
30: static char trimname[MAXNAME + 1];
31:
32: old = name;
33: new = trimname;
34: i = MAXNAME;
35:
36: while (i--)
37: if ((*new++ = *old++) == ' ')
38: {
39: new--;
40: break;
41: }
42:
43: *new = '\0';
44:
45: return (trimname);
46: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.