Skip to content

Commit

Permalink
supported loading .bundle library instead of .so.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kouji Takao committed Sep 17, 2011
1 parent e45f363 commit 9bc36ed
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions load.c
Expand Up @@ -186,6 +186,21 @@ check_path(const char *path, VALUE *out, int *type)
else if (strcmp(p + 1, "bundle") == 0) {
t = TYPE_BUNDLE;
}
else if (strcmp(p + 1, "so") == 0) {
const char *ext = "bundle";
const long ext_len = strlen(ext);
const long len = p - path;
if (len + ext_len + 1 < PATH_MAX) {
char buf[PATH_MAX];
strncpy(buf, path, PATH_MAX);
strcpy(buf + len + 1, ext);
buf[PATH_MAX - 1] = '\0';
if (path_ok(buf, out)) {
*type = TYPE_BUNDLE;
return true;
}
}
}
if (t != 0 && path_ok(path, out)) {
*type = t;
return true;
Expand Down

0 comments on commit 9bc36ed

Please sign in to comment.