Browse files

Force search of CWD for plugins

Windows and Mac default dylib search paths include current directory ;
Linux's do not. Force search in current working directory if path does
not contain a path separator character.
  • Loading branch information...
1 parent 883226e commit d5ea1da6b97174ae583dbabf0d942cd019c09f10 @kulp committed Sep 8, 2012
Showing with 4 additions and 2 deletions.
  1. +2 −1 src/devices/spi.c
  2. +2 −1 src/tsim.c
View
3 src/devices/spi.c
@@ -114,7 +114,8 @@ static int spi_emu_init(struct guest_ops *gops, void *hostcookie, void *cookie,
if (strchr(implname, PATH_SEPARATOR_CHAR)) {
implpath = implname;
} else {
- snprintf(buf, sizeof buf, "lib%s"DYLIB_SUFFIX, implname);
+ snprintf(buf, sizeof buf, ".%clib%s"DYLIB_SUFFIX,
+ PATH_SEPARATOR_CHAR, implname);
buf[sizeof buf - 1] = 0;
implpath = buf;
if (!implstem)
View
3 src/tsim.c
@@ -90,7 +90,8 @@ static int recipe_plugin(struct sim_state *s)
if (strchr(implname, PATH_SEPARATOR_CHAR)) {
implpath = implname;
} else {
- snprintf(buf, sizeof buf, "lib%s"DYLIB_SUFFIX, implname);
+ snprintf(buf, sizeof buf, ".%clib%s"DYLIB_SUFFIX,
+ PATH_SEPARATOR_CHAR, implname);
buf[sizeof buf - 1] = 0;
implpath = buf;
if (!implstem)

0 comments on commit d5ea1da

Please sign in to comment.