diff options
author | Ole Loots <ole@monochrom.net> | 2012-08-26 23:48:33 +0200 |
---|---|---|
committer | Ole Loots <ole@monochrom.net> | 2012-08-26 23:48:33 +0200 |
commit | 5a7ddb9e8478e18ac06871dc841cf7069a5ba949 (patch) | |
tree | 753ead004a70c84eafbe6e2b5566bde60f892863 | |
parent | 38c6e95f4e0681221f9a4f1517d68bac6e98da2c (diff) | |
download | netsurf-5a7ddb9e8478e18ac06871dc841cf7069a5ba949.tar.gz netsurf-5a7ddb9e8478e18ac06871dc841cf7069a5ba949.tar.bz2 |
Use is_dir to validate user selection.
-rwxr-xr-x | atari/global_evnt.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/atari/global_evnt.c b/atari/global_evnt.c index 1a0e8f646..0c9dfdc1e 100755 --- a/atari/global_evnt.c +++ b/atari/global_evnt.c @@ -170,21 +170,9 @@ static void __CDECL menu_save_page(WINDOW *win, int item, int title, void *data) do { // TODO: localize string - path = file_select( "Select folder", "" ); - if( path ) { - printf("testing: %s\n", path ); - // dumb check if the selection is an folder: - /*FILE * fp; - fp = fopen( path, "r" ); - if( !fp ){ - is_folder = true; - } else { - fclose( fp ); - form_alert(1, "[1][Please select an folder or abort!][OK]"); - } - */ - is_folder = true; - } + path = file_select("Select folder", ""); + if (path) + is_folder = is_dir(path); } while( !is_folder && path != NULL ); if( path != NULL ){ |