xref: /illumos-gate/usr/src/cmd/refer/glue2.c (revision 2a8bcb4e)
1*11a8fa6cSceastha /*
2*11a8fa6cSceastha  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
3*11a8fa6cSceastha  * Use is subject to license terms.
4*11a8fa6cSceastha  */
5*11a8fa6cSceastha 
67c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
77c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
87c478bd9Sstevel@tonic-gate 
97c478bd9Sstevel@tonic-gate /*
107c478bd9Sstevel@tonic-gate  * Copyright (c) 1980 Regents of the University of California.
117c478bd9Sstevel@tonic-gate  * All rights reserved. The Berkeley software License Agreement
127c478bd9Sstevel@tonic-gate  * specifies the terms and conditions for redistribution.
137c478bd9Sstevel@tonic-gate  */
147c478bd9Sstevel@tonic-gate 
157c478bd9Sstevel@tonic-gate char refdir[50];
167c478bd9Sstevel@tonic-gate 
17*11a8fa6cSceastha extern int corout();
18*11a8fa6cSceastha extern char *trimnl();
19*11a8fa6cSceastha 
20*11a8fa6cSceastha void
savedir(void)21*11a8fa6cSceastha savedir(void)
227c478bd9Sstevel@tonic-gate {
23*11a8fa6cSceastha 	if (refdir[0] == 0)
24*11a8fa6cSceastha 		corout("", refdir, "/usr/bin/pwd", "", 50);
257c478bd9Sstevel@tonic-gate 	trimnl(refdir);
267c478bd9Sstevel@tonic-gate }
277c478bd9Sstevel@tonic-gate 
28*11a8fa6cSceastha void
restodir(void)29*11a8fa6cSceastha restodir(void)
307c478bd9Sstevel@tonic-gate {
317c478bd9Sstevel@tonic-gate 	chdir(refdir);
327c478bd9Sstevel@tonic-gate }
33