From 5a7ddb9e8478e18ac06871dc841cf7069a5ba949 Mon Sep 17 00:00:00 2001 From: Ole Loots Date: Sun, 26 Aug 2012 23:48:33 +0200 Subject: Use is_dir to validate user selection. --- atari/global_evnt.c | 18 +++--------------- 1 file 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 ){ -- cgit v1.2.3