summaryrefslogtreecommitdiffstats
path: root/bin/sh/cd.c
diff options
context:
space:
mode:
authorsteve <steve@FreeBSD.org>1996-12-23 22:16:35 +0000
committersteve <steve@FreeBSD.org>1996-12-23 22:16:35 +0000
commit6da76fc1dd6a5125d867c9e73c56f9066c2b40b5 (patch)
tree50505f56894358d4c4bb32574ada6f6d9665d4a5 /bin/sh/cd.c
parenta845028255e2dba3dde6086a2f5344cbc6be82cd (diff)
downloadFreeBSD-src-6da76fc1dd6a5125d867c9e73c56f9066c2b40b5.zip
FreeBSD-src-6da76fc1dd6a5125d867c9e73c56f9066c2b40b5.tar.gz
Apply a little dab of bit caulk to keep those beggars
from leaking out. Noticed by: bde
Diffstat (limited to 'bin/sh/cd.c')
-rw-r--r--bin/sh/cd.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/bin/sh/cd.c b/bin/sh/cd.c
index 29f8f6c..caf8972 100644
--- a/bin/sh/cd.c
+++ b/bin/sh/cd.c
@@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: cd.c,v 1.8 1996/12/21 22:09:38 steve Exp $
+ * $Id: cd.c,v 1.9 1996/12/23 05:31:48 steve Exp $
*/
#ifndef lint
@@ -235,11 +235,7 @@ pwdcmd(argc, argv)
char *
getpwd()
{
- char *buf;
-
if (curdir)
return (curdir);
- if ((buf = getcwd(NULL, 0)) == NULL)
- return (NULL);
- return ((curdir = savestr(buf)));
+ return (getcwd(NULL, 0));
}
OpenPOWER on IntegriCloud