xref: /illumos-gate/usr/src/cmd/refer/glue2.c (revision 8b80e8cb6855118d46f605e91b5ed4ce83417395)
1 /*
2  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
7 /*	  All Rights Reserved  	*/
8 
9 /*
10  * Copyright (c) 1980 Regents of the University of California.
11  * All rights reserved. The Berkeley software License Agreement
12  * specifies the terms and conditions for redistribution.
13  */
14 
15 #pragma ident	"%Z%%M%	%I%	%E% SMI"
16 
17 
18 char refdir[50];
19 
20 extern int corout();
21 extern char *trimnl();
22 
23 void
24 savedir(void)
25 {
26 	if (refdir[0] == 0)
27 		corout("", refdir, "/usr/bin/pwd", "", 50);
28 	trimnl(refdir);
29 }
30 
31 void
32 restodir(void)
33 {
34 	chdir(refdir);
35 }
36