diff options
author | Roger Jungemann <roger@thefifthcircuit.com> | 2018-05-22 12:39:56 -0700 |
---|---|---|
committer | Roger Jungemann <roger@thefifthcircuit.com> | 2018-05-22 12:39:56 -0700 |
commit | 5ef2ffe450668a61fd9b4e356bf5148221281b32 (patch) | |
tree | 75689dfcad0f2c9f6539e5c86565ab512e59b8d8 /src/file.c | |
parent | 0c84e94563533d21a2129cc5d11f8912fb395a6b (diff) |
Allow for lua scripts in local .sc directory
Diffstat (limited to 'src/file.c')
-rw-r--r-- | src/file.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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/"); |