struct gvplugin_available_s {
gvplugin_available_t *next; /* next plugin in linked list, or NULL */
- const char *typestr; /* type string, e.g. "png" or "ps" */
+ char *typestr; /* type string, e.g. "png" or "ps" */
int quality; /* Programmer assigned quality ranking within type (+ve or -ve int).
First implementation of type should be given "0" quality */
gvplugin_package_t *package; /* details of library containing plugin */
{
gvplugin_available_t *plugin, **pnext;
#define TYPSIZ 63
- char *p, pins[TYPSIZ + 1], pnxt[TYPSIZ + 1];
+ char *p, *t, pins[TYPSIZ + 1], pnxt[TYPSIZ + 1];
+
+ /* duplicate typestr to later save in the plugin list */
+ t = strdup(typestr);
+ if (t == NULL)
+ return FALSE;
strncpy(pins, typestr, TYPSIZ);
if ((p = strchr(pins, ':')))
plugin = GNEW(gvplugin_available_t);
plugin->next = *pnext;
*pnext = plugin;
- plugin->typestr = typestr;
+ plugin->typestr = t;
plugin->quality = quality;
plugin->package = package;
plugin->typeptr = typeptr; /* null if not loaded */