/* Optimisation: Turn this into a 256 byte table:
* then can lookup in one index, not N checks */
static const Escape escapes[] = {
- { "<br>", '\n' },
- { "<ps>", '\n' },
- { "<\t>", '\t' },
- { "gt;", '>' },
- { "lt;", '<' },
- { "amp;", '&' },
- { "quot;", '\'' },
- { "dquot;", '"' }
+ { "<br>", '\n' },
+ { "<ps>", '\n' },
+ { "<\t>", '\t' },
+ { "gt;", '>' },
+ { "lt;", '<' },
+ { "amp;", '&' },
+ { "quot;", '\'' },
+ { "dquot;", '"' }
};
#define N_ESCAPES ((int)(sizeof(escapes) / sizeof(escapes[0])))
if (path)
{
char *modify = malloc(sizeof(char) * (strlen(value) + 1));
- strncpy(modify, "file://", 7);
- modify[7] = '\0';
+ strncpy(modify, "file://", 8);
path += 7;
while (path[1] && path[0] && path[1] == '/' && path[0] == '/')
{
if (path)
{
char *modify = malloc(sizeof(char) * (strlen(value) + 1));
- strncpy(modify, "file://", 7);
- modify[7] = '\0';
+ strncpy(modify, "file://", 8);
path += 7;
while (path[1] && path[0] && path[1] == '/' && path[0] == '/')
{
{
if ((atoms[j].atom == atomlist[i]) && (atoms[j].notify))
{
-/* if ((j == CNP_ATOM_text_uri) ||
+#if 0
+ if ((j == CNP_ATOM_text_uri) ||
(j == CNP_ATOM_text_urilist))
{
if(!is_uri_type_data(sel, notify)) continue;
- }*/
+ }
+#endif
cnp_debug("Atom %s matches\n",atoms[j].name);
goto done;
}
if (edje)
*data_ret = edje;
else
- *data_ret = strdup(sel->selbuf);
+ if (sel->selbuf)
+ *data_ret = strdup(sel->selbuf);
+ else
+ *data_ret = strdup("");
}
if (size_ret)
{
if (edje)
*size_ret = strlen(edje);
else
- *size_ret = strlen(sel->selbuf);
+ if (sel->selbuf)
+ *size_ret = strlen(sel->selbuf);
+ else
+ *size_ret = 0;
}
return EINA_TRUE;
if (html)
*data_ret = html;
else
- *data_ret = strdup(sel->selbuf);
+ if (sel->selbuf)
+ *data_ret = strdup(sel->selbuf);
+ else
+ *data_ret = strdup("");
}
if (size_ret)
if (html)
*size_ret = strlen(html);
else
- *size_ret = strlen(sel->selbuf);
+ if (sel->selbuf)
+ *size_ret = strlen(sel->selbuf);
+ else
+ *size_ret = 0;
}
if (convert_target != sel->selbuf)
free(convert_target);
tmppath = getenv("TMP");
if (!tmppath) tmppath = P_tmpdir;
- if (!tmppath) tmppath = "/tmp";
len = snprintf(NULL, 0, "%s/%sXXXXXX", tmppath, "elmcnpitem-");
if (len < 0)
{