When I created my patch I used the output of "svn diff" command, but i
had found that it generates an incorrect patch.
Especially if you add some lines at the end of the original file :O(
I don't know why this happened, but in other words, my previous patch,
can't be applied by the standard "patch" command (or ant <patch> target).
I attached to this post the right patch.
Sorry.
By Marco.
--- AspellWrapper.java (revision 8823)
+++ AspellWrapper.java (working copy)
@@ -62,7 +62,8 @@
aCommand[3] = "--lang="+this.aSpellDictionary;
aCommand[4] = "--encoding=UTF-8";
- String[] envArray = new String[0];
+ //MCM: use LD_LIBRARY_PATH if present into environment
+ String[] envArray = prepareEnv();
try
{
process = Runtime.getRuntime().exec(aCommand, envArray);
@@ -84,7 +85,8 @@
aCommand[2] = "dicts";
Vector dicts = new Vector();
- String[] envArray = new String[0];
+ //MCM: use LD_LIBRARY_PATH if present into environment
+ String[] envArray = prepareEnv();
try
{
process1 = Runtime.getRuntime().exec(aCommand, envArray);
@@ -204,6 +206,27 @@
this.aSpellLocation = location;
}
+ /**
+ * MCM: Prepare the custom environment for the aspell command
+ * by setting the LD_LIBRARY_PATH (if it was found into the
+ * running environment)
+ * This is useful for custom aspell installations (like my own)
+ **/
+ private String[] prepareEnv()
+ {
+ // use LD_LIBRARY_PATH if present into environment
+ String retValue[] = null;
+ String libraryPath = System.getenv("LD_LIBRARY_PATH");
+ if (libraryPath == null) {
+ retValue = new String[0];
+ } else {
+ retValue = new String[1];
+ retValue[0] = "LD_LIBRARY_PATH=" + libraryPath;
+ //System.out.println("MCM: Environment variable found: \""+retValue[0]+"\"");
+ }
+ return retValue;
+ }
+
/**
* Cleanup the process running aspell.
*/
********************************************
Hippocms-dev: Hippo CMS development public mailinglist