Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Dupplicate the string we put into the returned dynar, so that user can free it withou...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 27 Nov 2007 16:08:34 +0000 (16:08 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 27 Nov 2007 16:08:34 +0000 (16:08 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5072 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/xbt/xbt_str.c
src/xbt_str_unit.c

index edd062b..805adab 100644 (file)
@@ -249,6 +249,7 @@ xbt_dynar_t xbt_str_split_str(const char *s, const char *sep) {
   if (s[0] == '\0') 
     return res;
   if (sep[0] == '\0') {
   if (s[0] == '\0') 
     return res;
   if (sep[0] == '\0') {
+    s = xbt_strdup(s);
     xbt_dynar_push(res, &s);
     return res;
   }
     xbt_dynar_push(res, &s);
     return res;
   }
index 579d4b9..ecf9026 100644 (file)
@@ -8,7 +8,7 @@
 /* GENERATED FILE, DO NOT EDIT */
 /*******************************/
 
 /* GENERATED FILE, DO NOT EDIT */
 /*******************************/
 
-# 386 "xbt/xbt_str.c" 
+# 387 "xbt/xbt_str.c" 
 #define mytest(name, input, expected) \
   xbt_test_add0(name); \
   d=xbt_str_split_quoted(input); \
 #define mytest(name, input, expected) \
   xbt_test_add0(name); \
   d=xbt_str_split_quoted(input); \