summaryrefslogtreecommitdiffstats
path: root/src/file.c
diff options
context:
space:
mode:
authorRoger Jungemann <roger@thefifthcircuit.com>2018-05-22 12:39:56 -0700
committerRoger Jungemann <roger@thefifthcircuit.com>2018-05-22 12:39:56 -0700
commit5ef2ffe450668a61fd9b4e356bf5148221281b32 (patch)
tree75689dfcad0f2c9f6539e5c86565ab512e59b8d8 /src/file.c
parent0c84e94563533d21a2129cc5d11f8912fb395a6b (diff)
Allow for lua scripts in local .sc directory
Diffstat (limited to 'src/file.c')
-rw-r--r--src/file.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/file.c b/src/file.c
index 8ef6dc6..7fe945c 100644
--- a/src/file.c
+++ b/src/file.c
@@ -1339,7 +1339,17 @@ int max_length(FILE * f) {
int plugin_exists(char * name, int len, char * path) {
FILE * fp;
static char * HomeDir;
+ char cwd[1024];
+ if (getcwd(cwd, sizeof(cwd)) != NULL) {
+ strcpy((char *) path, cwd);
+ strcat((char *) path, "/");
+ strncat((char *) path, name, len);
+ if ((fp = fopen((char *) path, "r"))) {
+ fclose(fp);
+ return 1;
+ }
+ }
if ((HomeDir = getenv("HOME"))) {
strcpy((char *) path, HomeDir);
strcat((char *) path, "/.scim/");