diff options
author | 2008-09-21 00:17:29 -0400 | |
---|---|---|
committer | 2008-09-21 00:17:29 -0400 | |
commit | 14cc9fe52b4cc75553dd907882594467b16c5bf1 (patch) | |
tree | 6956b21cad4ef2e8ff684d30e59aadc86166ca89 /src/textadept.c | |
parent | 504360888bbe3e5bad4f203ae083de69f8b7e218 (diff) | |
download | textadept-14cc9fe52b4cc75553dd907882594467b16c5bf1.tar.gz textadept-14cc9fe52b4cc75553dd907882594467b16c5bf1.zip |
Use textadept.exe path as textadept_home instead of C:\Program Files\textadept.
Diffstat (limited to 'src/textadept.c')
-rw-r--r-- | src/textadept.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/textadept.c b/src/textadept.c index 6872e872..4d8f90d6 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -78,7 +78,14 @@ int main(int argc, char **argv) { } #ifdef WIN32 +char *textadept_home; int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR lpCmdLine, int) { + char path[260]; + GetModuleFileName(0, path, sizeof(path)); + char *last_slash = strrchr(path, '\\'); + if (last_slash) *last_slash = '\0'; + textadept_home = (char *)path; + // TODO: lpCmdLine contains command line string, pass to Lua gtk_init(0, NULL); l_init(0, NULL, false); |