aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjozan <jozan@noemail.net>2020-11-05 23:58:40 +0000
committerjozan <jozan@noemail.net>2020-11-05 23:58:40 +0000
commit605396e34906c2376f6fcfe3807d91ad16aededb (patch)
tree74e51641ae5637d2d6e7737019c41b7988f8db95
parentDuplicate done, trying to go recursive (diff)
downloadunixize-605396e34906c2376f6fcfe3807d91ad16aededb.tar.gz
unixize-605396e34906c2376f6fcfe3807d91ad16aededb.tar.bz2
unixize-605396e34906c2376f6fcfe3807d91ad16aededb.tar.xz
unixize-605396e34906c2376f6fcfe3807d91ad16aededb.tar.zst
unixize-605396e34906c2376f6fcfe3807d91ad16aededb.zip
Looks like I have to code well
FossilOrigin-Name: 8eaa944292a45f89e68881e14eac375478b489ebdb97d92dfb24ad914e828065
-rw-r--r--src/c_unixize.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/c_unixize.c b/src/c_unixize.c
index 23f29d9..5e92f71 100644
--- a/src/c_unixize.c
+++ b/src/c_unixize.c
@@ -66,8 +66,8 @@ main
struct lfiles_s* new_files;
struct lfiles_s* og_files_head;
struct lfiles_s* new_files_head;
- char rargv[8][3];
- char i;
+ int nargc;
+ char* nargv;
c_get_opts(&opts, argc, argv);
if (chdir((const char*)opts.dir) == -1) {
@@ -92,26 +92,17 @@ main
new_files = new_files->next;
continue;
}
- printf("'%s' -> '%s'\n", og_files->filename, new_files->filename);
if (opts.recursive == TRUE && og_files->filetype == DT_DIR) {
if (chdir((const char*)og_files->filename) == -1) {
u_dump_errno_path(og_files->filename);
}
else {
- i = 1;
- strlcpy(rargv[0], "-R", 3 * sizeof(char));
- if (opts.hidden == TRUE) {
- strlcpy(rargv[i], "-a", 3 * sizeof(char));
- i++;
- }
- if (opts.hyphen == TRUE) {
- strlcpy(rargv[i], "-n", 3 * sizeof(char));
- i++;
- }
- main();
+ /* rargc = u_get_rargv(&opts); */
+ main(nargc, (const char**)nargv);
chdir("../");
}
}
+ printf("'%s' -> '%s'\n", og_files->filename, new_files->filename);
/* rename(); */
og_files = og_files->next;
new_files = new_files->next;