disallow the empty string as token. Spotted by Kevin Cozens.

2004-10-04  Michael Natterer  <mitch@gimp.org>

	* tools/pdbgen/pdb/gimprc.pdb (gimprc_query, gimprc_set): disallow
	the empty string as token. Spotted by Kevin Cozens.

	* app/pdb/gimprc_cmds.c: regenerated.
This commit is contained in:
Michael Natterer 2004-10-04 19:30:16 +00:00 committed by Michael Natterer
parent cb18a9bd42
commit f20872950d
3 changed files with 35 additions and 13 deletions

View File

@ -1,3 +1,10 @@
2004-10-04 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/pdb/gimprc.pdb (gimprc_query, gimprc_set): disallow
the empty string as token. Spotted by Kevin Cozens.
* app/pdb/gimprc_cmds.c: regenerated.
2004-10-04 Sven Neumann <sven@gimp.org>
* libgimp/gimpaspectpreview.c (gimp_aspect_preview_draw_buffer):

View File

@ -20,6 +20,7 @@
#include "config.h"
#include <string.h>
#include <glib-object.h>
@ -70,11 +71,13 @@ gimprc_query_invoker (Gimp *gimp,
if (success)
{
/* use edit_config because unknown tokens are set there */
value = gimp_rc_query (GIMP_RC (gimp->edit_config), token);
if (strlen (token))
{
/* use edit_config because unknown tokens are set there */
value = gimp_rc_query (GIMP_RC (gimp->edit_config), token);
}
if (! value)
success = FALSE;
success = (value != NULL);
}
return_args = procedural_db_return_args (&gimprc_query_proc, success);
@ -139,8 +142,13 @@ gimprc_set_invoker (Gimp *gimp,
if (success)
{
/* use edit_config because that's the one that gets saved */
gimp_rc_set_unknown_token (GIMP_RC (gimp->edit_config), token, value);
if (strlen (token))
{
/* use edit_config because that's the one that gets saved */
gimp_rc_set_unknown_token (GIMP_RC (gimp->edit_config), token, value);
}
else
success = FALSE;
}
return procedural_db_return_args (&gimprc_set_proc, success);

View File

@ -56,11 +56,13 @@ HELP
vars => [ 'gchar *value = NULL' ],
code => <<'CODE'
{
/* use edit_config because unknown tokens are set there */
value = gimp_rc_query (GIMP_RC (gimp->edit_config), token);
if (strlen (token))
{
/* use edit_config because unknown tokens are set there */
value = gimp_rc_query (GIMP_RC (gimp->edit_config), token);
}
if (! value)
success = FALSE;
success = (value != NULL);
}
CODE
);
@ -91,8 +93,13 @@ HELP
headers => [ qw("config/gimpconfig.h") ],
code => <<'CODE'
{
/* use edit_config because that's the one that gets saved */
gimp_rc_set_unknown_token (GIMP_RC (gimp->edit_config), token, value);
if (strlen (token))
{
/* use edit_config because that's the one that gets saved */
gimp_rc_set_unknown_token (GIMP_RC (gimp->edit_config), token, value);
}
else
success = FALSE;
}
CODE
);
@ -200,7 +207,7 @@ CODE
);
}
@headers = qw("core/gimp.h");
@headers = qw(<string.h> "core/gimp.h");
@procs = qw(gimprc_query gimprc_set
get_default_comment get_monitor_resolution get_theme_dir