add search in current directory
Patch provided by Uros Platise https://sourceforge.net/p/ngspice/ngspice/merge-requests/4/
This commit is contained in:
parent
7c90004921
commit
19596f0f42
|
|
@ -1228,7 +1228,22 @@ inp_pathresolve_at(char *name, char *dir)
|
|||
}
|
||||
}
|
||||
|
||||
/* concatenate them */
|
||||
/*
|
||||
* Try in current dir and then in the actual dir the file was read.
|
||||
* Current dir . is needed to correctly support absolute paths in sourcepath
|
||||
*/
|
||||
|
||||
strcpy(buf, ".");
|
||||
|
||||
end = strchr(buf, '\0');
|
||||
if (end[-1] != DIR_TERM)
|
||||
*end++ = DIR_TERM;
|
||||
|
||||
strcpy(end, name);
|
||||
|
||||
char *r = inp_pathresolve(buf);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
strcpy(buf, dir);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue