summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake-build-debug/Testing/Temporary/LastTest.log4
-rw-r--r--main.c8
2 files changed, 7 insertions, 5 deletions
diff --git a/cmake-build-debug/Testing/Temporary/LastTest.log b/cmake-build-debug/Testing/Temporary/LastTest.log
index 56213aa..225e1e8 100644
--- a/cmake-build-debug/Testing/Temporary/LastTest.log
+++ b/cmake-build-debug/Testing/Temporary/LastTest.log
@@ -1,3 +1,3 @@
-Start testing: Feb 22 21:47 CET
+Start testing: Feb 23 12:12 CET
----------------------------------------------------------
-End testing: Feb 22 21:47 CET
+End testing: Feb 23 12:12 CET
diff --git a/main.c b/main.c
index 79117fa..dcad1f2 100644
--- a/main.c
+++ b/main.c
@@ -42,9 +42,9 @@ void remove_file(const char *path);
void remove_dir(const char *path); // trying to delete the folder and the files init recursively
-void copy_files(struct split_arg);
+void copy_files(struct split_arg argument);
-void move_files(struct split_arg);
+void move_files(struct split_arg argument);
void print_cdirectory(const char *arg);
@@ -115,6 +115,7 @@ void exec_command(char *input) {
for (int i = 0; i < sizeof(CommandsList) / sizeof(CommandsList[0]); i++) {
if (strcmp(user_command.com, CommandsList[i].cmd) == 0) {
CommandsList[i].func(user_command.arg);
+ break;
}
}
free(user_command.com);
@@ -154,7 +155,8 @@ void remove_dir(const char *path) {
}
// ReSharper disable once CppPointerConversionDropsQualifiers
- while ((entry = readdir(dP)) != NULL) {
+ while ((entry = readdir(dP)) != NULL && (strcmp(entry->d_name, ".") != 0) && (
+ strcmp(entry->d_name, "..") != 0)) {
if (rmdir(entry->d_name) != 0) {
perror("failed to delete the directory 02");
}