| 747 { |
747 { |
| 748 char *dirname; |
748 char *dirname; |
| 749 |
749 |
| 750 if (g_file_test(path, G_FILE_TEST_IS_DIR)) { |
750 if (g_file_test(path, G_FILE_TEST_IS_DIR)) { |
| 751 /* append a / if needed */ |
751 /* append a / if needed */ |
| 752 if (path[strlen(path) - 1] != '/') { |
752 if (path[strlen(path) - 1] != G_DIR_SEPARATOR) { |
| 753 dirname = g_strconcat(path, "/", NULL); |
753 dirname = g_strconcat(path, G_DIR_SEPARATOR_S, NULL); |
| 754 } else { |
754 } else { |
| 755 dirname = g_strdup(path); |
755 dirname = g_strdup(path); |
| 756 } |
756 } |
| 757 gtk_file_selection_set_filename(filesel, dirname); |
757 gtk_file_selection_set_filename(filesel, dirname); |
| 758 g_free(dirname); |
758 g_free(dirname); |