Skip to content

Commit c44e2f5

Browse files
committed
Fix search handle issue
1 parent f10834a commit c44e2f5

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

hd.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -308,24 +308,25 @@ int process_cmdline_args(int argc,
308308
}
309309

310310

311-
int process_files(char * search_handle, char * search_path)
311+
int process_files(HANDLE search_handle, char * search_path)
312312
{
313313
int i;
314314

315315
/** Attempt to retrieve first file */
316-
if ((search_handle = FindFirstFile((LPCTSTR)search_path, &g_file_data_t))
317-
== INVALID_HANDLE_VALUE) {
316+
search_handle = FindFirstFile((LPCTSTR) search_path, &g_file_data_t);
317+
if (search_handle == INVALID_HANDLE_VALUE) {
318318
puts("\nNo file or folder found.");
319319

320320
restore_console();
321321
return -1;
322322

323-
} else if((long)search_handle == ERROR_FILE_NOT_FOUND) {
324-
puts("\nNo file or folder found.");
325-
326-
restore_console();
327-
return -1;
328323
}
324+
// else if (search_handle == ERROR_FILE_NOT_FOUND) {
325+
// puts("\nNo file or folder found.");
326+
//
327+
// restore_console();
328+
// return -1;
329+
// }
329330

330331
do {
331332
/* File is directory ? */

hd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ int display_help();
5454
int fixup_path(char * search_path);
5555
struct console_info * get_console_info();
5656
int process_cmdline_args(int argc, char * argv[], char search_drive, char * search_path, char * search_string);
57-
int process_files(char * search_handle, char * search_path);
57+
int process_files(HANDLE search_handle, char * search_path);
5858
int restore_console();
5959

6060
#endif /* HD_H */

0 commit comments

Comments
 (0)