fix usage of dirname()

This commit is contained in:
h_vogt 2011-06-25 20:34:28 +00:00
parent aac6d0802f
commit f3565bab6b
2 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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 <ngspice-directory>/input or, if set, to
environment variable NGSPICE_INPUT */
mkvar(&Inp_Path, ngpath, "input", "NGSPICE_INPUT");