]> diplodocus.org Git - nmh/blob - docs/historical/mh-jun-1982/subs/path.c
Create new mh-format function %(ordinal)
[nmh] / docs / historical / mh-jun-1982 / subs / path.c
1 #ifdef COMMENT
2 Proprietary Rand Corporation, 1981.
3 Further distribution of this software
4 subject to the terms of the Rand
5 license agreement.
6 #endif
7
8 #include "../mh.h"
9
10 char *path(name, type)
11 register char *name;
12 {
13 static char *pwds;
14
15 if(*name == '/' ||
16 (type == TFOLDER && *name != '.'))
17 return name;
18 if(!pwds)
19 pwds = pwd();
20 if(*name == '.' && name[1] == '/')
21 name += 2;
22 return concat(pwds, "/", name, 0);
23 }