mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-08-22 05:47:42 +02:00
main.c, add USERPROFILE to search path for .spiceinit
search sequence: current directory, HOME, USERPROFILE
This commit is contained in:
+10
@@ -1143,6 +1143,15 @@ main(int argc, char **argv)
|
|||||||
/* if that failed try in the user's home directory
|
/* if that failed try in the user's home directory
|
||||||
if their HOME environment variable is set */
|
if their HOME environment variable is set */
|
||||||
char *homedir = getenv("HOME");
|
char *homedir = getenv("HOME");
|
||||||
|
if (homedir) {
|
||||||
|
if (FALSE == read_initialisation_file(homedir, INITSTR) &&
|
||||||
|
FALSE == read_initialisation_file(homedir, ALT_INITSTR)) {
|
||||||
|
;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/* If there is no HOME environment (e.g. MS Windows), try user's profile directory */
|
||||||
|
homedir = getenv("USERPROFILE");
|
||||||
if (homedir)
|
if (homedir)
|
||||||
if (FALSE == read_initialisation_file(homedir, INITSTR) &&
|
if (FALSE == read_initialisation_file(homedir, INITSTR) &&
|
||||||
FALSE == read_initialisation_file(homedir, ALT_INITSTR)) {
|
FALSE == read_initialisation_file(homedir, ALT_INITSTR)) {
|
||||||
@@ -1150,6 +1159,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!ft_batchmode) {
|
if (!ft_batchmode) {
|
||||||
com_version(NULL);
|
com_version(NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user