rem: gchar* file_selection_get_last_directory(GtkFileSelection* filesel,gboolean ended) {{{ */ {
add: gchar* file_selection_get_last_directory(GtkFileSelection* filesel,gboolean ended) {
context: gchar* file_selection_get_last_directory(GtkFileSelection* filesel,gboolean ended) /* {{{ */{    gchar*   dirstr      = g_strdup(GTK_LABEL(GTK_BIN(GTK_OPTION_MENU(filesel->history_pulldown))->child)->label);    gint     dirstr_len  = strlen(dirstr);    gchar*   sepstr      = g_strdup(G_DIR_SEPARATOR_S);    gint     sepstr_len  = strlen(sepstr);    gboolean is_endedstr = FALSE;    // Chek if the sirectory string is ended by a separator    // (if directory string  is small than the separator string    //  it can ot be ended by the separator string)    if ( dirstr_len >= sepstr_len)     {        is_endedstr = (gboolean)(!strncmp( dirstr + dirstr_len - sepstr_len, sepstr, sepstr_len));    }    // We want the dirstr ended by a sepstrarator but there no    if (ended&&!is_endedstr)    {        dirstr = g_strconcat(dirstr,G_DIR_SEPARATOR_S,NULL);    }    // We do not want to have a separator at the end, but there is one     else if ((!ended)&&is_endedstr)    {        dirstr[dirstr_len-sepstr_len-1] = 0;    }        return g_filename_to_utf8(dirstr,-1,NULL,NULL,NULL);} /* }}} file_selection_get_last_directory */