Index: branches/reyalp-flt/lib/lang/lang.c
===================================================================
--- branches/reyalp-flt/lib/lang/lang.c	(revision 1466)
+++ branches/reyalp-flt/lib/lang/lang.c	(revision 1488)
@@ -69,7 +69,10 @@
 // buf - source array (content of file.lng )
 //-------------------------------------------------------------------
-void lang_parse_from_mem(char *buf) {
+int lang_parse_from_mem(char *buf, int size) {
     char *p, *s, *e;
     int i;
+
+	if  ( size <= 0 )
+	  return 0;
 
     e = buf-1;
@@ -95,4 +98,5 @@
         }
     }
+	return 1;
 }
 
@@ -116,9 +120,13 @@
 }
 
-
+// PURPOSE:
 // Universal file processor
 // Load file, process by callback, unalloc/close file
+// RETURN:
+//	 Transfer return value from callback
+// NOTE:
+//	 Call callback even if fail to load/malloc (size=-1 if no file, size=0 if empty) 
 //-------------------------------------------------------------------
-void load_from_file(const char *filename, callback_process_file callback)
+int load_from_file(const char *filename, callback_process_file callback)
 {
     int f, size;
@@ -126,18 +134,25 @@
     char *buf;
 
+	buf = 0;
+    size = -1;
+
     f = open(filename, O_RDONLY, 0777);
-    if (f>=0) {
+    if (f>=0)
         size = (stat((char*)filename, &st)==0)?st.st_size:0;
-        if (size) {
+    if (size>0 )
             buf = umalloc(size+1);
             if (buf) {
                 size = read(f, buf, size);
                 buf[size]=0;
-                callback(buf);
+	}
+
+	size = callback( buf, size);
+
+	if ( buf )
                 ufree(buf);
-            }
-        }
+    if (f>=0)
         close(f);
-    }
+
+	return size;
 }
 
