OSDN Git Service

Some improvements for ignore errors mode.
authorLoRd_MuldeR <mulder2@gmx.de>
Mon, 22 Jan 2018 20:11:54 +0000 (21:11 +0100)
committerLoRd_MuldeR <mulder2@gmx.de>
Mon, 22 Jan 2018 20:11:54 +0000 (21:11 +0100)
src/main++.cpp
src/main.c

index 26c2821..7e12a1d 100644 (file)
@@ -51,6 +51,10 @@ static int process_file(const int multi_file, const param_t *const param, uint64
                        print_logo();
                        FPRINTF(stderr, T("Given input file is not readable:\n%s\n\n%s\n\n"), file_name ? file_name : T("<STDIN>"), STRERROR(errno));
                }
+               else
+               {
+                       FPRINTF(stderr, T("Skipped file: %s\n"), file_name ? file_name : T("<STDIN>"));
+               }
                return 0;
        }
 
@@ -62,6 +66,11 @@ static int process_file(const int multi_file, const param_t *const param, uint64
                        print_logo();
                        FPRINTF(stderr, T("Failed to open input file:\n%s\n\n%s\n\n"), file_name ? file_name : T("<STDIN>"), STRERROR(errno));
                }
+               else
+               {
+                       FPRINTF(stderr, T("Skipped file: %s\n"), file_name ? file_name : T("<STDIN>"));
+
+               }
                return 0;
        }
 
@@ -101,6 +110,10 @@ static int process_file(const int multi_file, const param_t *const param, uint64
                        print_logo();
                        FPUTS(T("File read error has occurred!\n"), stderr);
                }
+               else
+               {
+                       FPRINTF(stderr, T("I/O error on: %s\n"), file_name ? file_name : T("<STDIN>"));
+               }
                fclose(source);
                return 0;
        }
index 38e125d..1bc49b5 100644 (file)
@@ -52,6 +52,10 @@ static int process_file(const int multi_file, const param_t *const param, uint64
                        print_logo();
                        FPRINTF(stderr, T("Given input file is not readable:\n%s\n\n%s\n\n"), file_name ? file_name : T("<STDIN>"), STRERROR(errno));
                }
+               else
+               {
+                       FPRINTF(stderr, T("Skipped file: %s\n"), file_name ? file_name : T("<STDIN>"));
+               }
                return 0;
        }
 
@@ -63,6 +67,11 @@ static int process_file(const int multi_file, const param_t *const param, uint64
                        print_logo();
                        FPRINTF(stderr, T("Failed to open input file:\n%s\n\n%s\n\n"), file_name ? file_name : T("<STDIN>"), STRERROR(errno));
                }
+               else
+               {
+                       FPRINTF(stderr, T("Skipped file: %s\n"), file_name ? file_name : T("<STDIN>"));
+
+               }
                return 0;
        }
 
@@ -100,7 +109,11 @@ static int process_file(const int multi_file, const param_t *const param, uint64
                if (!param->ignore_errors)
                {
                        print_logo();
-                       FPUTS(T("File read error has occurred!\n"), stderr);
+                       FPUTS(T("File read error has occurred, aborting!\n"), stderr);
+               }
+               else
+               {
+                       FPRINTF(stderr, T("I/O error on: %s\n"), file_name ? file_name : T("<STDIN>"));
                }
                fclose(source);
                return 0;