[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-dev] [Patch] Allow installation to $HOME under linux



Installation to $HOME doesn't work under linux because sclang attempts
to load user extensions twice.

This is because SC_DATA_DIR is set by scons, and this value is used to
set gSystemExtensionDir to the same value as gUserExtensionDir.

The patch below simply checks if the two are the same before
processing gUserExtensionDir.

I'm not sure if strcmp is safe for this under all systems, it works
here.

Regards,
Rohan

Index: source/lang/LangSource/PyrLexer.cpp
===================================================================
--- source/lang/LangSource/PyrLexer.cpp (revision 5472)
+++ source/lang/LangSource/PyrLexer.cpp (working copy)
@@ -2028,7 +2028,8 @@
                          if (!success) return false;
                        }
 
-                       if(sc_DirectoryExists(gUserExtensionDir)) {
+                       if(sc_DirectoryExists(gUserExtensionDir) &&
+                          (strcmp(gSystemExtensionDir,gUserExtensionDir) != 0)) {
                          success = passOne_ProcessDir(gUserExtensionDir,0);
                          if (!success) return false;
                        }