aboutsummaryrefslogtreecommitdiffstats
path: root/code/tools/lcc/etc/lcc.c
diff options
context:
space:
mode:
Diffstat (limited to 'code/tools/lcc/etc/lcc.c')
-rw-r--r--code/tools/lcc/etc/lcc.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/code/tools/lcc/etc/lcc.c b/code/tools/lcc/etc/lcc.c
index 89706df..4a6d0f6 100644
--- a/code/tools/lcc/etc/lcc.c
+++ b/code/tools/lcc/etc/lcc.c
@@ -74,6 +74,31 @@ static List lccinputs; /* list of input directories */
int main(int argc, char *argv[]) {
int i, j, nf;
+#ifdef _WIN32
+ // Tim Angus <tim@ngus.net> 05/09/05
+ // Append the base path of this file to the PATH
+ // There are probably (much) cleaner ways of doing this, but
+ // IANAWD (Windows Developer)
+ {
+ char basepath[ 1024 ];
+ char path[ 4096 ];
+ char *p;
+
+ strncpy( basepath, argv[ 0 ], 1024 );
+ p = strrchr( basepath, '\\' );
+
+ if( p )
+ {
+ *p = '\0';
+ strncpy( path, "PATH=", 4096 );
+ strncat( path, getenv( "PATH" ), 4096 );
+ strncat( path, ";", 4096 );
+ strncat( path, basepath, 4096 );
+ _putenv( path );
+ }
+ }
+#endif
+
progname = argv[0];
ac = argc + 50;
av = alloc(ac*sizeof(char *));