Browse Source

add search in current directory

Patch provided by Uros Platise
https://sourceforge.net/p/ngspice/ngspice/merge-requests/4/
pre-master-46
Holger Vogt 8 years ago
parent
commit
19596f0f42
  1. 17
      src/frontend/inpcom.c

17
src/frontend/inpcom.c

@ -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…
Cancel
Save