]> Kevux Git Server - fll/commitdiff
Bugfix: featureless make is not copying settings directory.
authorKevin Day <thekevinday@gmail.com>
Sun, 29 Nov 2020 06:58:58 +0000 (00:58 -0600)
committerKevin Day <thekevinday@gmail.com>
Sun, 29 Nov 2020 06:58:58 +0000 (00:58 -0600)
The contents of the directory are being copied instead of the directory itself.
Change the behavior to instead copy the entire directory and not just its contents.

Also move the directory check into its own line instead of inline inside of an if condition.
The signal check is moved with it.

level_3/fake/c/private-build.c

index 0eab15bbcceafbafddb5d2fdd227f78e10fe9de9..6e98d06e16e34017eeda54e237a91806a09341d3 100644 (file)
@@ -227,29 +227,53 @@ extern "C" {
         break;
       }
 
-      if ((*status = f_directory_is(path_source.string)) == F_true) {
+      *status = f_directory_is(path_source.string);
 
-        if (fake_signal_received(data)) {
-          *status = F_status_set_error(F_signal);
+      if (fake_signal_received(data)) {
+        *status = F_status_set_error(F_signal);
+        break;
+      }
+
+      if (*status == F_true) {
+        destination_directory.used = 0;
+
+        *status = fl_string_dynamic_append(destination, &destination_directory);
+
+        if (F_status_is_error(*status)) {
+          fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_append", F_true);
+          break;
+        }
+
+        *status = f_file_name_base(path_source.string, path_source.used, &destination_directory);
+
+        if (F_status_is_error(*status)) {
+          fll_error_print(data.error, F_status_set_fine(*status), "f_file_name_base", F_true);
+          break;
+        }
+
+        *status = fl_string_dynamic_terminate_after(&destination_directory);
+
+        if (F_status_is_error(*status)) {
+          fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
           break;
         }
 
-        *status = fl_directory_copy_content(path_source.string, destination.string, path_source.used, destination.used, mode, recurse);
+        *status = fl_directory_copy(path_source.string, destination_directory.string, path_source.used, destination_directory.used, mode, recurse);
 
         if (F_status_is_error(*status)) {
           if (data.error.verbosity == f_console_verbosity_verbose) {
             for (f_string_length_t j = 0; j < failures.used; j++) {
-              fake_print_error_build_operation_file(data, F_status_set_fine(*status), "fl_directory_copy_content", "copy contents of", "to", path_source.string, destination.string, F_true);
+              fake_print_error_build_operation_file(data, F_status_set_fine(*status), "fl_directory_copy", "copy directory", "to", path_source.string, destination_directory.string, F_true);
             } // for
 
             if (F_status_set_fine(*status) != F_failure) {
-              fll_error_print(data.error, F_status_set_fine(*status), "fl_directory_copy_content", F_true);
+              fll_error_print(data.error, F_status_set_fine(*status), "fl_directory_copy", F_true);
             }
 
             break;
           }
           else if (data.error.verbosity != f_console_verbosity_quiet) {
-            fake_print_error_build_operation_file(data, F_status_set_fine(*status), "fl_directory_copy_content", "copy contents of", "to", path_source.string, destination.string, F_true);
+            fake_print_error_build_operation_file(data, F_status_set_fine(*status), "fl_directory_copy", "copy directory", "to", path_source.string, destination_directory.string, F_true);
           }
 
           break;