From 14cc9fe52b4cc75553dd907882594467b16c5bf1 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Sun, 21 Sep 2008 00:17:29 -0400 Subject: Use textadept.exe path as textadept_home instead of C:\Program Files\textadept. --- src/textadept.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/textadept.c') 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); -- cgit v1.2.3