Re: _set_value bug (and a patch)

Nikolai Kondrashov <[email protected]>
Newsgroups gmane.text.clearsilver.general
Message-ID <[email protected]>
Just in case someone needs this patch and wasn't subscribed to yahoo groups
at the time of writing, I'm resending it in the body (yahoo groups won't
store an attachment, unfortunately).

---:<---
--- util/neo_hdf.c      (revision 40079)
+++ util/neo_hdf.c      (working copy)
@@ -640,7 +640,24 @@
     return nerr_raise(NERR_ASSERT, "Unable to set Empty component %s", name);
   }

-  hn = hdf;
+  if (hdf->link)
+  {
+    char *new_name = (char *) malloc(strlen(hdf->value) + 1 + strlen(name)
+ 1);
+    if (new_name == NULL)
+    {
+      return nerr_raise(NERR_NOMEM, "Unable to allocate memory");
+    }
+    strcpy(new_name, hdf->value);
+    strcat(new_name, ".");
+    strcat(new_name, name);
+    err = _set_value (hdf->top, new_name, value, dup, wf, link, attr,
set_node);
+    free(new_name);
+    return nerr_pass(err);
+  }
+  else
+  {
+    hn = hdf;
+  }

   while (1)
   {
@@ -779,7 +796,7 @@
       }
       strcpy(new_name, hp->value);
       strcat(new_name, s);
-      err = _set_value (hdf, new_name, value, dup, wf, link, attr, set_node);
+      err = _set_value (hdf->top, new_name, value, dup, wf, link, attr,
set_node);
       free(new_name);
       return nerr_pass(err);
     }
--->:---


Sincerely,
Nick


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ClearSilver/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ClearSilver/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.