]> git.seodisparate.com - SimpleArchiver/commitdiff
Refactorings (handling some TODOs)
authorStephen Seo <seo.disparate@gmail.com>
Mon, 10 Feb 2025 06:17:21 +0000 (15:17 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Mon, 10 Feb 2025 06:17:21 +0000 (15:17 +0900)
src/parser.c

index 2c594e16c746d0922ac0782c58eb726540ae39e8..a84d80560e3acc73c600f18ef60ba08ead81ff41 100644 (file)
@@ -678,9 +678,7 @@ int simple_archiver_parse_args(int argc, const char **argv,
           ++ptr;
         }
 
-        // TODO verify this is necessary, using different variables.
-        ptr = out->working_files;
-        out->working_files = realloc(ptr, sizeof(char *) * (working_size + 1));
+        out->working_files = realloc(out->working_files, sizeof(char *) * (working_size + 1));
 
         // Set new actual last element to NULL.
         out->working_files[working_size] = NULL;
@@ -958,7 +956,10 @@ SDArchiverLinkedList *simple_archiver_parsed_to_filenames(
               // Is a directory.
               simple_archiver_list_add_front(dir_list, combined_path, NULL);
             } else {
-              // Unhandled type. TODO handle this.
+              fprintf(stderr,
+                      "NOTICE: Not a file, symlink, or directory: \"%s\"."
+                        " Skipping...\n",
+                      combined_path);
               free(combined_path);
             }
           }
@@ -984,7 +985,10 @@ SDArchiverLinkedList *simple_archiver_parsed_to_filenames(
         }
       }
     } else {
-      // Unhandled type. TODO handle this.
+      fprintf(stderr,
+              "NOTICE: Not a file, symlink, or directory: \"%s\"."
+                " Skipping...\n",
+              file_path);
     }
   }
 #endif