Commit e1c68749 authored by Sven Neumann's avatar Sven Neumann

Was strtok used correctly here?? I think not!


--Sven
parent 970a3dae
Thu Jan 6 01:29:20 CET 2000 Sven Neumann <sven@gimp.org>
* app/general.c
* app/plug_in.c: I might be wrong, but I think strtok wasn't used
correctly here
Thu Jan 6 00:58:32 CET 2000 Sven Neumann <sven@gimp.org>
* plug-ins/bmp/bmp.c
......
......@@ -538,13 +538,15 @@ GSList*
plug_in_extensions_parse (char *extensions)
{
GSList *list;
char *extension;
gchar *extension;
gchar *next_token;
list = NULL;
/* EXTENSIONS can be NULL. Avoid calling strtok if it is. */
if (extensions)
{
extensions = g_strdup (extensions);
extension = strtok (extensions, " \t,");
next_token = extensions;
extension = strtok (next_token, " \t,");
while (extension)
{
list = g_slist_prepend (list, g_strdup (extension));
......
......@@ -38,12 +38,15 @@ search_in_path (char *search_path,
char *filename)
{
static char path[256];
char *local_path, *token;
gchar *local_path;
gchar *token;
gchar *next_token;
struct stat buf;
int err;
local_path = g_strdup (search_path);
token = strtok (local_path, G_SEARCHPATH_SEPARATOR_S);
next_token = local_path;
token = strtok (next_token, G_SEARCHPATH_SEPARATOR_S);
while (token)
{
......
......@@ -538,13 +538,15 @@ GSList*
plug_in_extensions_parse (char *extensions)
{
GSList *list;
char *extension;
gchar *extension;
gchar *next_token;
list = NULL;
/* EXTENSIONS can be NULL. Avoid calling strtok if it is. */
if (extensions)
{
extensions = g_strdup (extensions);
extension = strtok (extensions, " \t,");
next_token = extensions;
extension = strtok (next_token, " \t,");
while (extension)
{
list = g_slist_prepend (list, g_strdup (extension));
......
......@@ -538,13 +538,15 @@ GSList*
plug_in_extensions_parse (char *extensions)
{
GSList *list;
char *extension;
gchar *extension;
gchar *next_token;
list = NULL;
/* EXTENSIONS can be NULL. Avoid calling strtok if it is. */
if (extensions)
{
extensions = g_strdup (extensions);
extension = strtok (extensions, " \t,");
next_token = extensions;
extension = strtok (next_token, " \t,");
while (extension)
{
list = g_slist_prepend (list, g_strdup (extension));
......
......@@ -538,13 +538,15 @@ GSList*
plug_in_extensions_parse (char *extensions)
{
GSList *list;
char *extension;
gchar *extension;
gchar *next_token;
list = NULL;
/* EXTENSIONS can be NULL. Avoid calling strtok if it is. */
if (extensions)
{
extensions = g_strdup (extensions);
extension = strtok (extensions, " \t,");
next_token = extensions;
extension = strtok (next_token, " \t,");
while (extension)
{
list = g_slist_prepend (list, g_strdup (extension));
......
......@@ -538,13 +538,15 @@ GSList*
plug_in_extensions_parse (char *extensions)
{
GSList *list;
char *extension;
gchar *extension;
gchar *next_token;
list = NULL;
/* EXTENSIONS can be NULL. Avoid calling strtok if it is. */
if (extensions)
{
extensions = g_strdup (extensions);
extension = strtok (extensions, " \t,");
next_token = extensions;
extension = strtok (next_token, " \t,");
while (extension)
{
list = g_slist_prepend (list, g_strdup (extension));
......
......@@ -538,13 +538,15 @@ GSList*
plug_in_extensions_parse (char *extensions)
{
GSList *list;
char *extension;
gchar *extension;
gchar *next_token;
list = NULL;
/* EXTENSIONS can be NULL. Avoid calling strtok if it is. */
if (extensions)
{
extensions = g_strdup (extensions);
extension = strtok (extensions, " \t,");
next_token = extensions;
extension = strtok (next_token, " \t,");
while (extension)
{
list = g_slist_prepend (list, g_strdup (extension));
......
......@@ -538,13 +538,15 @@ GSList*
plug_in_extensions_parse (char *extensions)
{
GSList *list;
char *extension;
gchar *extension;
gchar *next_token;
list = NULL;
/* EXTENSIONS can be NULL. Avoid calling strtok if it is. */
if (extensions)
{
extensions = g_strdup (extensions);
extension = strtok (extensions, " \t,");
next_token = extensions;
extension = strtok (next_token, " \t,");
while (extension)
{
list = g_slist_prepend (list, g_strdup (extension));
......
......@@ -538,13 +538,15 @@ GSList*
plug_in_extensions_parse (char *extensions)
{
GSList *list;
char *extension;
gchar *extension;
gchar *next_token;
list = NULL;
/* EXTENSIONS can be NULL. Avoid calling strtok if it is. */
if (extensions)
{
extensions = g_strdup (extensions);
extension = strtok (extensions, " \t,");
next_token = extensions;
extension = strtok (next_token, " \t,");
while (extension)
{
list = g_slist_prepend (list, g_strdup (extension));
......
......@@ -538,13 +538,15 @@ GSList*
plug_in_extensions_parse (char *extensions)
{
GSList *list;
char *extension;
gchar *extension;
gchar *next_token;
list = NULL;
/* EXTENSIONS can be NULL. Avoid calling strtok if it is. */
if (extensions)
{
extensions = g_strdup (extensions);
extension = strtok (extensions, " \t,");
next_token = extensions;
extension = strtok (next_token, " \t,");
while (extension)
{
list = g_slist_prepend (list, g_strdup (extension));
......
......@@ -538,13 +538,15 @@ GSList*
plug_in_extensions_parse (char *extensions)
{
GSList *list;
char *extension;
gchar *extension;
gchar *next_token;
list = NULL;
/* EXTENSIONS can be NULL. Avoid calling strtok if it is. */
if (extensions)
{
extensions = g_strdup (extensions);
extension = strtok (extensions, " \t,");
next_token = extensions;
extension = strtok (next_token, " \t,");
while (extension)
{
list = g_slist_prepend (list, g_strdup (extension));
......
......@@ -538,13 +538,15 @@ GSList*
plug_in_extensions_parse (char *extensions)
{
GSList *list;
char *extension;
gchar *extension;
gchar *next_token;
list = NULL;
/* EXTENSIONS can be NULL. Avoid calling strtok if it is. */
if (extensions)
{
extensions = g_strdup (extensions);
extension = strtok (extensions, " \t,");
next_token = extensions;
extension = strtok (next_token, " \t,");
while (extension)
{
list = g_slist_prepend (list, g_strdup (extension));
......
......@@ -538,13 +538,15 @@ GSList*
plug_in_extensions_parse (char *extensions)
{
GSList *list;
char *extension;
gchar *extension;
gchar *next_token;
list = NULL;
/* EXTENSIONS can be NULL. Avoid calling strtok if it is. */
if (extensions)
{
extensions = g_strdup (extensions);
extension = strtok (extensions, " \t,");
next_token = extensions;
extension = strtok (next_token, " \t,");
while (extension)
{
list = g_slist_prepend (list, g_strdup (extension));
......
......@@ -538,13 +538,15 @@ GSList*
plug_in_extensions_parse (char *extensions)
{
GSList *list;
char *extension;
gchar *extension;
gchar *next_token;
list = NULL;
/* EXTENSIONS can be NULL. Avoid calling strtok if it is. */
if (extensions)
{
extensions = g_strdup (extensions);
extension = strtok (extensions, " \t,");
next_token = extensions;
extension = strtok (next_token, " \t,");
while (extension)
{
list = g_slist_prepend (list, g_strdup (extension));
......
......@@ -538,13 +538,15 @@ GSList*
plug_in_extensions_parse (char *extensions)
{
GSList *list;
char *extension;
gchar *extension;
gchar *next_token;
list = NULL;
/* EXTENSIONS can be NULL. Avoid calling strtok if it is. */
if (extensions)
{
extensions = g_strdup (extensions);
extension = strtok (extensions, " \t,");
next_token = extensions;
extension = strtok (next_token, " \t,");
while (extension)
{
list = g_slist_prepend (list, g_strdup (extension));
......
......@@ -538,13 +538,15 @@ GSList*
plug_in_extensions_parse (char *extensions)
{
GSList *list;
char *extension;
gchar *extension;
gchar *next_token;
list = NULL;
/* EXTENSIONS can be NULL. Avoid calling strtok if it is. */
if (extensions)
{
extensions = g_strdup (extensions);
extension = strtok (extensions, " \t,");
next_token = extensions;
extension = strtok (next_token, " \t,");
while (extension)
{
list = g_slist_prepend (list, g_strdup (extension));
......
......@@ -538,13 +538,15 @@ GSList*
plug_in_extensions_parse (char *extensions)
{
GSList *list;
char *extension;
gchar *extension;
gchar *next_token;
list = NULL;
/* EXTENSIONS can be NULL. Avoid calling strtok if it is. */
if (extensions)
{
extensions = g_strdup (extensions);
extension = strtok (extensions, " \t,");
next_token = extensions;
extension = strtok (next_token, " \t,");
while (extension)
{
list = g_slist_prepend (list, g_strdup (extension));
......
......@@ -538,13 +538,15 @@ GSList*
plug_in_extensions_parse (char *extensions)
{
GSList *list;
char *extension;
gchar *extension;
gchar *next_token;
list = NULL;
/* EXTENSIONS can be NULL. Avoid calling strtok if it is. */
if (extensions)
{
extensions = g_strdup (extensions);
extension = strtok (extensions, " \t,");
next_token = extensions;
extension = strtok (next_token, " \t,");
while (extension)
{
list = g_slist_prepend (list, g_strdup (extension));
......
......@@ -538,13 +538,15 @@ GSList*
plug_in_extensions_parse (char *extensions)
{
GSList *list;
char *extension;
gchar *extension;
gchar *next_token;
list = NULL;
/* EXTENSIONS can be NULL. Avoid calling strtok if it is. */
if (extensions)
{
extensions = g_strdup (extensions);
extension = strtok (extensions, " \t,");
next_token = extensions;
extension = strtok (next_token, " \t,");
while (extension)
{
list = g_slist_prepend (list, g_strdup (extension));
......
......@@ -538,13 +538,15 @@ GSList*
plug_in_extensions_parse (char *extensions)
{
GSList *list;
char *extension;
gchar *extension;
gchar *next_token;
list = NULL;
/* EXTENSIONS can be NULL. Avoid calling strtok if it is. */
if (extensions)
{
extensions = g_strdup (extensions);
extension = strtok (extensions, " \t,");
next_token = extensions;
extension = strtok (next_token, " \t,");
while (extension)
{
list = g_slist_prepend (list, g_strdup (extension));
......
......@@ -538,13 +538,15 @@ GSList*
plug_in_extensions_parse (char *extensions)
{
GSList *list;
char *extension;
gchar *extension;
gchar *next_token;
list = NULL;
/* EXTENSIONS can be NULL. Avoid calling strtok if it is. */
if (extensions)
{
extensions = g_strdup (extensions);
extension = strtok (extensions, " \t,");
next_token = extensions;
extension = strtok (next_token, " \t,");
while (extension)
{
list = g_slist_prepend (list, g_strdup (extension));
......
Markdown is supported
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