diff options
author | Matthias Clasen <mclasen@redhat.com> | 2005-07-01 15:51:30 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2005-07-01 15:51:30 +0000 |
commit | 7dc4d68410384a618c7da14b405071bb21537ad4 (patch) | |
tree | e9a3652d3c767436f3acff36510a52a0576fc62d /gtk/gtkfilesel.c | |
parent | 1bf3ada15baedaced5e95e4657c4d279c540ea36 (diff) | |
download | gtk+-7dc4d68410384a618c7da14b405071bb21537ad4.tar.gz |
Prevent an infinite loop when G_FILENAME_ENCODING is invalid. (#309280,
2005-07-01 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkfilesel.c (cmpl_init_state): Prevent an infinite
loop when G_FILENAME_ENCODING is invalid. (#309280, Padraig Brady)
Diffstat (limited to 'gtk/gtkfilesel.c')
-rw-r--r-- | gtk/gtkfilesel.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c index fd13b1f57c..f82e81f914 100644 --- a/gtk/gtkfilesel.c +++ b/gtk/gtkfilesel.c @@ -2671,13 +2671,14 @@ cmpl_init_state (void) { gchar *utf8_cwd; CompletionState *new_state; + gint tries = 0; new_state = g_new (CompletionState, 1); utf8_cwd = get_current_dir_utf8 (); tryagain: - + tries++; new_state->reference_dir = NULL; new_state->completion_dir = NULL; new_state->active_completion_dir = NULL; @@ -2697,7 +2698,8 @@ tryagain: { /* Directories changing from underneath us, grumble */ strcpy (utf8_cwd, G_DIR_SEPARATOR_S); - goto tryagain; + if (tries < 2) + goto tryagain; } g_free (utf8_cwd); |