[SCM] Lisaac compiler branch, lisaac-0.13.x, updated. lisaac-0.13.1-2-gf68a8f6

Mildred Ki'Lya silkensedai at online.fr
Mon Aug 3 18:23:46 UTC 2009


The following commit has been merged in the lisaac-0.13.x branch:
commit f68a8f6560aab8546c1a4445b7eb674c04b145da
Author: Mildred Ki'Lya <silkensedai at online.fr>
Date:   Mon Aug 3 20:23:34 2009 +0200

    Added support for LISAAC_DIRECTORY environment variable that override the directory defined in path.h. If this environment variable is not set, the builtin directory in path.h is used instead

diff --git a/src/lisaac.li b/src/lisaac.li
index fe183a4..4633f1e 100644
--- a/src/lisaac.li
+++ b/src/lisaac.li
@@ -291,25 +291,31 @@ Section Private
 
   - load_directory <-
   ( + var_lisaac:STRING_CONSTANT;
+    + path_str :STRING;
     + path:NATIVE_ARRAY[CHARACTER];
     (target=NULL).if {
       target := ALIAS_STR.section_default;
     };
-    path := `LISAAC_DIRECTORY`:NATIVE_ARRAY[CHARACTER];
-    var_lisaac := STRING_CONSTANT.new_intern path
-    count (path.fast_first_index_of '\0' until 1024);
-    //var_lisaac := ENVIRONMENT.get_environment_variable "LISAAC";
-    //(var_lisaac = NULL).if {
-    //  STD_ERROR.put_string "Unable to find `LISAAC' environment variable.\n";
-    //  STD_ERROR.put_string "Please, set the environment variable `LISAAC'\n";
-    //  STD_ERROR.put_string "with the appropriate absolute path to lisaac root directory.\n";
-    //  STD_ERROR.put_string "Example: 'set LISAAC=/lisaac/'\n";
-    //  die_with_code exit_failure_code;
-    //};
-    //
-    string_tmp.copy var_lisaac;
-    ((var_lisaac.last != '/') &&
-    {var_lisaac.last != '\\'}).if {
+    path_str := ENVIRONMENT.get_environment_variable "LISAAC_DIRECTORY";
+    (path_str != NULL).if {
+      string_tmp.copy path_str;
+    } else {
+      path := `LISAAC_DIRECTORY`:NATIVE_ARRAY[CHARACTER];
+      var_lisaac := STRING_CONSTANT.new_intern path
+      count (path.fast_first_index_of '\0' until 1024);
+      //var_lisaac := ENVIRONMENT.get_environment_variable "LISAAC";
+      //(var_lisaac = NULL).if {
+      //  STD_ERROR.put_string "Unable to find `LISAAC' environment variable.\n";
+      //  STD_ERROR.put_string "Please, set the environment variable `LISAAC'\n";
+      //  STD_ERROR.put_string "with the appropriate absolute path to lisaac root directory.\n";
+      //  STD_ERROR.put_string "Example: 'set LISAAC=/lisaac/'\n";
+      //  die_with_code exit_failure_code;
+      //};
+      //
+      string_tmp.copy var_lisaac;
+    };
+    ((string_tmp.last != '/') &&
+     {string_tmp.last != '\\'}).if {
       string_tmp.add_last '/';
     };
     PARSER.read_path_directory (ALIAS_STR.get string_tmp) target target 

-- 
Lisaac compiler



More information about the Lisaac-commits mailing list