Skip to content
Snippets Groups Projects
Commit db363909 authored by gb10's avatar gb10
Browse files

Added code to unescape the URL tag that is passed in the GFF file for variations

parent 3ec50baa
No related branches found
No related tags found
No related merge requests found
......@@ -534,31 +534,6 @@ static void parseAttributes(char *attributes,
}
/* Utility to remove any GFF3 escape characters from the given string and replace them with
* the real characters they represent. Takes into account special chars for generic attributes,
* and also the Target-name and ID attributes if requested */
static void replaceGff3EscapeChars(char **text, const gboolean targetNameAtt, const gboolean idAtt)
{
GString *gstr = g_string_new(*text);
seqtools_g_string_replace(gstr, "%3b", ";");
seqtools_g_string_replace(gstr, "%3d", "=");
seqtools_g_string_replace(gstr, "%09", "\t");
/* Target-name and ID attributes additionally have whitespace escaped */
if (targetNameAtt || idAtt)
seqtools_g_string_replace(gstr, "%20", " ");
/* ID attribute additional has ">" escaped */
if (idAtt)
seqtools_g_string_replace(gstr, "%e3", ">");
g_free(*text);
*text = gstr->str;
g_string_free(gstr, FALSE);
}
/* Parse a tag/data pair of the format "tag=data" */
static void parseTagDataPair(char *text,
const int lineNum,
......@@ -607,8 +582,11 @@ static void parseTagDataPair(char *text,
}
else if (!strcmp(tokens[0], "url"))
{
#if GLIB_MAJOR_VERSION >= 2 && GLIB_MINOR_VERSION >= 16
gffData->url = g_uri_unescape_string(tokens[1], NULL);
#else
gffData->url = g_strdup(tokens[1]);
replaceGff3EscapeChars(&gffData->url, FALSE, FALSE);
#endif
}
else
{
......
......@@ -88,7 +88,7 @@
01-10-05 Added getsseqsPfetch to fetch all missing sseqs in one go via socket connection to pfetch [RD]
* Created: Thu Feb 20 10:27:39 1993 (esr)
* CVS info: $Id: blxview.c,v 1.75 2010-10-05 17:40:20 gb10 Exp $
* CVS info: $Id: blxview.c,v 1.76 2010-10-18 14:06:53 gb10 Exp $
*-------------------------------------------------------------------
*/
......@@ -1596,6 +1596,12 @@ void destroyMspData(MSP *msp)
g_array_free(msp->xy, TRUE);
msp->xy = NULL;
}
if (msp->url)
{
g_free(msp->url);
msp->url = NULL;
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment