From c3badfd017d809e54d7267b4d7eaab69517c0abd Mon Sep 17 00:00:00 2001 From: dwarning Date: Wed, 2 Jan 2008 18:34:03 +0000 Subject: [PATCH] don't need buffer w/o getcwd --- src/frontend/com_chdir.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/frontend/com_chdir.c b/src/frontend/com_chdir.c index e4f535ce6..83e75e3f5 100644 --- a/src/frontend/com_chdir.c +++ b/src/frontend/com_chdir.c @@ -3,10 +3,9 @@ * $Id$ ************/ -#include -#include +#include "ngspice.h" -#include +#include "wordlist.h" #ifdef HAVE_PWD_H #include @@ -24,7 +23,9 @@ com_chdir(wordlist *wl) #ifdef HAVE_PWD_H struct passwd *pw; #endif +#ifdef HAVE_GETCWD char localbuf[257]; +#endif int copied = 0; s = NULL; @@ -50,8 +51,8 @@ com_chdir(wordlist *wl) if (s != NULL) - if (chdir(s) == -1) - perror(s); + if (chdir(s) == -1) + perror(s); if (copied) tfree(s);