Revision: 2743 http://geany.svn.sourceforge.net/geany/?rev=2743&view=rev Author: eht16 Date: 2008-07-03 05:32:55 -0700 (Thu, 03 Jul 2008)
Log Message: ----------- Fix unnecessary 40 character limit for auto-closing XML tags (closes #2007278).
Modified Paths: -------------- trunk/ChangeLog trunk/src/utils.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-07-02 13:40:06 UTC (rev 2742) +++ trunk/ChangeLog 2008-07-03 12:32:55 UTC (rev 2743) @@ -1,3 +1,10 @@ +2008-07-03 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> + + * src/utils.c: + Fix unnecessary 40 character limit for auto-closing XML tags + (closes #2007278). + + 2008-07-02 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/keybindings.c:
Modified: trunk/src/utils.c =================================================================== --- trunk/src/utils.c 2008-07-02 13:40:06 UTC (rev 2742) +++ trunk/src/utils.c 2008-07-03 12:32:55 UTC (rev 2743) @@ -249,15 +249,12 @@ */ gchar *utils_find_open_xml_tag(const gchar sel[], gint size, gboolean check_tag) { - /* 40 chars per tag should be enough, or not? */ - gint i = 0, max_tag_size = 40; - gchar *result = g_malloc(max_tag_size); + GString *result = g_string_sized_new(64); const gchar *begin, *cur;
if (size < 3) - { - /* Smallest tag is "<p>" which is 3 characters */ - return result; + { /* Smallest tag is "<p>" which is 3 characters */ + return NULL; } begin = &sel[0]; if (check_tag) @@ -276,16 +273,15 @@ if (*cur == '<') { cur++; - while((strchr(":_-.", *cur) || isalnum(*cur)) && i < (max_tag_size - 1)) + while((strchr(":_-.", *cur) || isalnum(*cur))) { - result[i++] = *cur; + g_string_append_c(result, *cur); cur++; } }
- result[i] = '\0'; /* Return the tag name or "" */ - return result; + return g_string_free(result, FALSE); }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.