mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-03 17:56:17 +01:00
Remove some special-casing of empty string which led to dangling pointers.
2006-04-27 Matthias Clasen <mclasen@redhat.com> * glib/gbookmarkfile.c (g_bookmark_file_set_description) (g_bookmark_file_set_title, g_bookmark_file_set_icon): Remove some special-casing of empty string which led to dangling pointers. (#339337, Morten Welinder) (expand_exec_line): Don't use printf() needlessly, handle trailing '%' gracefully. (#339338, Morten Welinder) (is_element_full): Silence the compiler.
This commit is contained in:
parent
6ea2f9a2c6
commit
86eb750432
@ -4,6 +4,9 @@
|
|||||||
(g_bookmark_file_set_title, g_bookmark_file_set_icon):
|
(g_bookmark_file_set_title, g_bookmark_file_set_icon):
|
||||||
Remove some special-casing of empty string which led to
|
Remove some special-casing of empty string which led to
|
||||||
dangling pointers. (#339337, Morten Welinder)
|
dangling pointers. (#339337, Morten Welinder)
|
||||||
|
(expand_exec_line): Don't use printf() needlessly, handle
|
||||||
|
trailing '%' gracefully. (#339338, Morten Welinder)
|
||||||
|
(is_element_full): Silence the compiler.
|
||||||
|
|
||||||
2006-04-27 Behdad Esfahbod <behdad@gnome.org>
|
2006-04-27 Behdad Esfahbod <behdad@gnome.org>
|
||||||
|
|
||||||
|
@ -4,6 +4,9 @@
|
|||||||
(g_bookmark_file_set_title, g_bookmark_file_set_icon):
|
(g_bookmark_file_set_title, g_bookmark_file_set_icon):
|
||||||
Remove some special-casing of empty string which led to
|
Remove some special-casing of empty string which led to
|
||||||
dangling pointers. (#339337, Morten Welinder)
|
dangling pointers. (#339337, Morten Welinder)
|
||||||
|
(expand_exec_line): Don't use printf() needlessly, handle
|
||||||
|
trailing '%' gracefully. (#339338, Morten Welinder)
|
||||||
|
(is_element_full): Silence the compiler.
|
||||||
|
|
||||||
2006-04-27 Behdad Esfahbod <behdad@gnome.org>
|
2006-04-27 Behdad Esfahbod <behdad@gnome.org>
|
||||||
|
|
||||||
|
@ -1000,9 +1000,8 @@ is_element_full (ParseData *parse_data,
|
|||||||
const gchar *element,
|
const gchar *element,
|
||||||
const gchar sep)
|
const gchar sep)
|
||||||
{
|
{
|
||||||
gchar *ns_uri, *ns_name;
|
gchar *ns_uri, *ns_name, *s, *resolved;
|
||||||
gchar *element_name, *resolved;
|
const gchar *p, *element_name;
|
||||||
gchar *p, *s;
|
|
||||||
gboolean retval;
|
gboolean retval;
|
||||||
|
|
||||||
g_assert (parse_data != NULL);
|
g_assert (parse_data != NULL);
|
||||||
@ -3282,14 +3281,16 @@ expand_exec_line (const gchar *exec_fmt,
|
|||||||
ch = *exec_fmt++;
|
ch = *exec_fmt++;
|
||||||
switch (ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
|
case '\0':
|
||||||
|
goto out;
|
||||||
case 'u':
|
case 'u':
|
||||||
g_string_append_printf (exec, "%s", uri);
|
g_string_append (exec, uri);
|
||||||
break;
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
{
|
{
|
||||||
gchar *file = g_filename_from_uri (uri, NULL, NULL);
|
gchar *file = g_filename_from_uri (uri, NULL, NULL);
|
||||||
g_string_append_printf (exec, "%s", file);
|
g_string_append (exec, file);
|
||||||
g_free (file);
|
g_free (file);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '%':
|
case '%':
|
||||||
@ -3299,6 +3300,7 @@ expand_exec_line (const gchar *exec_fmt,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
return g_string_free (exec, FALSE);
|
return g_string_free (exec, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user