From f3565bab6bc372533b65d6c1fef2f18435ad20df Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sat, 25 Jun 2011 20:34:28 +0000 Subject: [PATCH] fix usage of dirname() --- ChangeLog | 3 +++ src/misc/ivars.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index f238d1d9c..7bf992f44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2011-06-25 Holger Vogt + * ivars.c: fix usage of dirname() + 2011-06-25 Robert Larice * src/ngsconvert.c : ngsconvert.c, swallow type conversion warnings diff --git a/src/misc/ivars.c b/src/misc/ivars.c index 19bd381d0..c3c0bf7eb 100644 --- a/src/misc/ivars.c +++ b/src/misc/ivars.c @@ -82,7 +82,12 @@ ivars(char *argv0) mkvar(&Spice_Path, Spice_Exec_Dir, "ngspice", "SPICE_PATH"); /* may be used to store input files (*.lib, *.include, ...) */ /* get directory where ngspice resides */ +#if defined(_MSC_VER) || defined(__MINGW32__) /* FIXME dirname() different in util.c and LINUX */ ngpath = dirname(argv0); +#else + ngpath = copy(argv0); + dirname(ngpath); +#endif /* set path either to /input or, if set, to environment variable NGSPICE_INPUT */ mkvar(&Inp_Path, ngpath, "input", "NGSPICE_INPUT");