Enlightenment CVS committal

Author  : lordchaos
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_config


Modified Files:
        ecore_config_db.c 


Log Message:
* Remove the 255 character string limit on ecore_config strings

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_config/ecore_config_db.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- ecore_config_db.c   18 Sep 2005 12:25:57 -0000      1.8
+++ ecore_config_db.c   15 Nov 2005 10:04:41 -0000      1.9
@@ -223,7 +223,8 @@
 _ecore_config_db_write(Ecore_Config_DB_File *db, const char *key)
 {
    char buf[256];
-   int num;
+   char* str = NULL;
+   int num = 0;
    char *prev_locale;
    // Ecore_Config_Prop *prop;
    Ecore_Config_Type type;
@@ -246,9 +247,12 @@
               num = snprintf(buf, sizeof(buf), "%c %16.16f ", (char) type,
                              ecore_config_float_get(key));
               break;
-            case ECORE_CONFIG_STR:
-              num = snprintf(buf, sizeof(buf), "%c %s ", (char) type,
+            case ECORE_CONFIG_STR: {
+              int slen = (strlen(ecore_config_string_get(key)) * sizeof(char)) 
+ 3;
+              str = malloc(slen);
+              num = snprintf(str, slen, "%c %s ", (char) type,
                              ecore_config_string_get(key));
+              }
               break;
             case ECORE_CONFIG_THM:
               num = snprintf(buf, sizeof(buf), "%c %s ", (char) type,
@@ -263,9 +267,17 @@
          }
 
    if (prev_locale) setlocale(LC_NUMERIC, prev_locale);
-   buf[1] = 0;
-   buf[num - 1] = 0;
-   eet_write(db->ef, (char*)key, buf, num, 1);
+   
+   if (!(type == ECORE_CONFIG_STR)) {
+          buf[1] = 0;
+          buf[num - 1] = 0;
+          eet_write(db->ef, (char*)key, buf, num, 1);
+   } else {
+          str[1] = 0;
+          str[num-1] = 0;
+          eet_write(db->ef, (char*)key, str, num, 1);
+          free(str);
+   }
 }
 /*
 void




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to