xref: /original-bsd/usr.bin/f77/libF77/lnblnk_.c (revision 2301fdfb)
1 /*
2  * Copyright (c) 1980 Regents of the University of California.
3  * All rights reserved.  The Berkeley software License Agreement
4  * specifies the terms and conditions for redistribution.
5  *
6  *	@(#)lnblnk_.c	5.2	06/07/85
7  *
8  * find last occurrence of a non-blank character in string
9  *
10  * calling sequence:
11  *	character*(*) string
12  *	indx = lnblnk (string)
13  * where:
14  *	indx will be the index of the last occurence
15  *	of a non-blank character in string, or zero if not found.
16  */
17 
18 long lnblnk_(str, slen)
19 char *str; long slen;
20 {
21 	register char *p = str + slen;
22 
23 	while (--p >= str && *p == ' ' ) ;
24 	return((long)(++p - str));
25 }
26