Last change
on this file since b8080f6 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 8 years ago |
Imported original source code.
|
-
Property mode
set to
100755
|
File size:
564 bytes
|
Rev | Line | |
---|
[3ae31e9] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | strrtrm() -- trim trailing blanks from a string, in-place
|
---|
| 4 | Version 1 -- 1988-08-19 -- D.N. Lynx Crowe
|
---|
| 5 |
|
---|
| 6 | Returns a pointer to the string.
|
---|
| 7 | =============================================================================
|
---|
| 8 | */
|
---|
| 9 |
|
---|
| 10 | #include "stddefs.h"
|
---|
| 11 |
|
---|
| 12 | char *
|
---|
| 13 | strrtrm(s)
|
---|
| 14 | char *s;
|
---|
| 15 | {
|
---|
| 16 | register char *lp, *rp;
|
---|
| 17 |
|
---|
| 18 | lp = s;
|
---|
| 19 | rp = s;
|
---|
| 20 |
|
---|
| 21 | while (*rp)
|
---|
| 22 | ++rp;
|
---|
| 23 |
|
---|
| 24 | while ((long)(--rp) GE (long)lp) {
|
---|
| 25 |
|
---|
| 26 | if (*rp EQ ' ')
|
---|
| 27 | *rp = '\0';
|
---|
| 28 | else
|
---|
| 29 | break;
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 | return(lp);
|
---|
| 33 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.