aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/c_lfiles.c29
-rw-r--r--src/c_unixize.c2
2 files changed, 20 insertions, 11 deletions
diff --git a/src/c_lfiles.c b/src/c_lfiles.c
index c39cd02..53f8ad3 100644
--- a/src/c_lfiles.c
+++ b/src/c_lfiles.c
@@ -115,16 +115,19 @@ c_lfiles_new
return (link);
}
-/* struct lfiles_s* */
-/* c_lfiles_duplicate(struct lfiles_s** head) */
-/* { */
-/* struct lfiles_s* dup; */
-/* struct lfiles_s* origin; */
-/* */
-/* if (head == NULL) { */
-/* return (NULL); */
-/* } */
-/* } */
+struct lfiles_s*
+c_lfiles_duplicate(struct lfiles_s** head)
+{
+ struct lfiles_s* dup_head;
+ struct lfiles_s* dup_link;
+ struct lfiles_s* origin;
+
+ if (*head == NULL) {
+ return (NULL);
+ }
+ origin = *head;
+ return (dup_head);
+}
struct lfiles_s*
c_lfiles_gather(void)
@@ -147,6 +150,12 @@ c_lfiles_gather(void)
return (NULL);
}
while ((dp = readdir(dirp)) != NULL) {
+ if (
+ strncmp(dp->d_name, ".", 2 * sizeof(char)) == 0 ||
+ strncmp(dp->d_name, "..", 3 * sizeof(char)) == 0
+ ) {
+ continue;
+ }
link = c_lfiles_new(dp->d_name, dp->d_type);
if (link == NULL) {
u_dump_errno();
diff --git a/src/c_unixize.c b/src/c_unixize.c
index 31bae1b..078423a 100644
--- a/src/c_unixize.c
+++ b/src/c_unixize.c
@@ -66,7 +66,7 @@ main
c_get_opts(&opts, argc, argv);
if (chdir((const char*)opts.dir) == -1) {
- u_dump_err();
+ u_dump_errno();
return (1);
}
og_files = c_lfiles_gather();