From 7bee34c7cdcea7d01f20eb6537edb30ca2961966 Mon Sep 17 00:00:00 2001 From: benfry Date: Fri, 26 Sep 2003 16:54:42 +0000 Subject: [PATCH] fixes for quotes bug on CLASSPATH that was preventing javacomm from working --- build/windows/launcher/launcher.cpp | 55 +++++++++++++++----------- build/windows/launcher/processing.exe | Bin 111773 -> 111773 bytes 2 files changed, 33 insertions(+), 22 deletions(-) diff --git a/build/windows/launcher/launcher.cpp b/build/windows/launcher/launcher.cpp index 09fbe2fa6..321821d8b 100644 --- a/build/windows/launcher/launcher.cpp +++ b/build/windows/launcher/launcher.cpp @@ -95,35 +95,35 @@ WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow) } */ - char *env_qtjava = (char *)malloc(256 * sizeof(char)); - env_qtjava[0] = 0; + char *qtjava_path = (char *)malloc(256 * sizeof(char)); + qtjava_path[0] = 0; if (getenv("WINDIR") == NULL) { // uh-oh.. serious problem.. gonna have to report this // but hopefully WINDIR is set on win98 too } else { - strcpy(env_qtjava, getenv("WINDIR")); - strcat(env_qtjava, "\\SYSTEM32\\QTJava.zip"); + strcpy(qtjava_path, getenv("WINDIR")); + strcat(qtjava_path, "\\SYSTEM32\\QTJava.zip"); - FILE *fp = fopen(env_qtjava, "rb"); + FILE *fp = fopen(qtjava_path, "rb"); if (fp != NULL) { fclose(fp); // found it, all set - strcat(env_qtjava, ";"); // add path separator + strcat(qtjava_path, ";"); // add path separator } else { - strcpy(env_qtjava, getenv("WINDIR")); - strcat(env_qtjava, "\\SYSTEM\\QTJava.zip"); + strcpy(qtjava_path, getenv("WINDIR")); + strcat(qtjava_path, "\\SYSTEM\\QTJava.zip"); - fp = fopen(env_qtjava, "rb"); + fp = fopen(qtjava_path, "rb"); if (fp != NULL) { fclose(fp); // found it, all set - strcat(env_qtjava, ";"); // add path separator + strcat(qtjava_path, ";"); // add path separator } else { // doesn't seem to be installed, which is a problem. // but the error will be reported by the pde - env_qtjava[0] = 0; + qtjava_path[0] = 0; } } } @@ -153,29 +153,40 @@ WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow) } */ - // put quotes around contents of cp, - // because %s might have spaces in it. + // NO! put quotes around contents of cp, because %s might have spaces in it. + // don't put quotes in it, because it's setting the environment variable + // for CLASSPATH, not being included on the command line. so setting the + // env var it's ok to have spaces, and the quotes prevent + // javax.comm.properties from being found. sprintf(cp, - "\"" // begin quote + //"\"" // begin quote + //"'" + "%s" "%s" "%s" + + "%s\\lib\\comm.jar;" "%s\\lib;" "%s\\lib\\build;" "%s\\lib\\pde.jar;" "%s\\lib\\kjc.jar;" "%s\\lib\\oro.jar;" - "%s\\lib\\antlr.jar;" - "%s\\lib\\comm.jar;" + "%s\\lib\\antlr.jar;", + //"C:\\WINNT\\system32\\QTJava.zip;" // worthless //"C:\\WINDOWS\\system32\\QTJava.zip;" - "\"", // end quote - //localJreInstalled ? "java\\lib\\rt.jar;" : "", - local_jre_installed ? "java\\lib\\rt.jar;" : "", //rt_jar, - env_qtjava, + + //"\"", // end quote + //"'", + //, + + // the first three %s args + local_jre_installed ? "java\\lib\\rt.jar;" : "", + qtjava_path, env_classpath, - //envClasspath ? envClasspath : "", - //envClasspath ? ";" : "", + + // the next several %s args loaddir, loaddir, loaddir, loaddir, loaddir, loaddir, loaddir); if (!SetEnvironmentVariable("CLASSPATH", cp)) { diff --git a/build/windows/launcher/processing.exe b/build/windows/launcher/processing.exe index 4b9cd9bbea4dd349741454d09b37b9c9895d7beb..88e358e3bc51006ceaf04b0ce32483f75793b9db 100755 GIT binary patch delta 82 zcmbRHl5Orwwh0}~5%R?oyM389rfj^W#wMm(41qB@nMpCp`MJ4zS&2o~liAsWCTFpm iZJx(&!OW2ShVLxmnMpCp`MJ4zS&2o~ nN|Q6#%{DJ!H)H0=7It7LW!+IT`5u=gV{Nkp_jU