Mercurial > pidgin
diff src/util.c @ 1035:80a47e3b1bca
[gaim-migrate @ 1045]
thanks to bmiller for yet another patch ;)
committer: Tailor Script <tailor@pidgin.im>
| author | Eric Warmenhoven <eric@warmenhoven.org> |
|---|---|
| date | Tue, 31 Oct 2000 07:36:11 +0000 |
| parents | 38452403563b |
| children | 56c7ceb986a8 |
line wrap: on
line diff
--- a/src/util.c Tue Oct 31 07:18:44 2000 +0000 +++ b/src/util.c Tue Oct 31 07:36:11 2000 +0000 @@ -1272,3 +1272,22 @@ return retval; } + +int file_is_dir (char *path, GtkWidget *w) +{ + struct stat st; + char *name; + + if (stat(path, &st) == 0 && S_ISDIR(st.st_mode)) { + /* append a / if needed */ + if (path[strlen(path)-1] != '/') + name = g_strconcat(path,"/",NULL); + else + name = g_strdup(path); + gtk_file_selection_set_filename(GTK_FILE_SELECTION(w), name); + g_free(name); + return 1; + } + + return 0; +}
