summaryrefslogtreecommitdiff
path: root/patches/dev300/piece-jvmfwk.diff
blob: b400537de38864ca3091d9cd4d3400f15f083037 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--- jvmfwk/source/fwkutil.hxx.old	2008-06-13 16:12:18.000000000 +0200
+++ jvmfwk/source/fwkutil.hxx	2008-10-07 22:38:51.000000000 +0200
@@ -40,7 +40,9 @@
 #if OSL_DEBUG_LEVEL >=2
 #include <stdio.h>
 #endif
-
+#include <limits.h>
+#include <stdlib.h>
+#include <string.h>
 
 namespace jfw
 {
@@ -56,9 +58,14 @@ rtl::OUString getLibraryLocation();
 struct Bootstrap :
 	public ::rtl::StaticWithInit< const rtl::Bootstrap *, Bootstrap > {
 		const rtl::Bootstrap * operator () () {
-            ::rtl::OUStringBuffer buf(256);
-            buf.append(getLibraryLocation());
-            buf.appendAscii(SAL_CONFIGFILE("/jvmfwk3"));
+            ::rtl::OUStringBuffer buf(PATH_MAX);
+            const char * pJVMFWK_CONFIGFILE = getenv("JVMFWK_CONFIGFILE");
+            if (pJVMFWK_CONFIGFILE && strlen(pJVMFWK_CONFIGFILE)) {
+            buf.appendAscii(pJVMFWK_CONFIGFILE);
+            } else {
+            buf.append(getLibraryLocation());
+            buf.appendAscii(SAL_CONFIGFILE("/jvmfwk3"));
+            }
             ::rtl::OUString sIni = buf.makeStringAndClear();
             ::rtl::Bootstrap *  bootstrap = new ::rtl::Bootstrap(sIni);
 #if OSL_DEBUG_LEVEL >=2