From 3ef04cfdf3bb63c4fa72a2642dc264562bfd8242 Mon Sep 17 00:00:00 2001 From: jozan Date: Sat, 14 Nov 2020 16:27:49 +0000 Subject: Recursive bug fix FossilOrigin-Name: ab695ff8af7123fc04eec76b8215fd60ad0cc98d1444ec87fcabd3322b6323fa --- .fossil-settings/ignore-glob | 1 + src/c_opts.c | 9 +++------ src/c_unixize.c | 4 ++-- src/c_unixize.h | 2 +- src/u_utils.c | 4 ++-- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.fossil-settings/ignore-glob b/.fossil-settings/ignore-glob index df8b23b..e90232e 100644 --- a/.fossil-settings/ignore-glob +++ b/.fossil-settings/ignore-glob @@ -2,5 +2,6 @@ obj unixize git compile_flags.txt +.clang_complete test test2 diff --git a/src/c_opts.c b/src/c_opts.c index 786a16c..6df0722 100644 --- a/src/c_opts.c +++ b/src/c_opts.c @@ -113,7 +113,7 @@ c_recursive_parse opts->pretend = TRUE; } else if ((*ptr)[0] == 'r') { - opts->rpretend = TRUE; + opts->rverbose = TRUE; } else if ((*ptr)[0] == 'R') { opts->recursive = TRUE; @@ -147,7 +147,7 @@ c_get_opts opts->hyphen = FALSE; opts->preserve = FALSE; opts->pretend = FALSE; - opts->rpretend = FALSE; + opts->rverbose = FALSE; opts->recursive = FALSE; opts->verbose = FALSE; opts->cxx = 0; @@ -175,7 +175,7 @@ c_get_opts opts->pretend = TRUE; } else if (opt == 'r') { - opts->rpretend = TRUE; + opts->rverbose = TRUE; } else if (opt == 'R') { opts->recursive = TRUE; @@ -221,8 +221,5 @@ c_get_opts if (opts->confirm == TRUE) { ret = c_prompt_confirm(); } - if (opts->pretend == TRUE) { - opts->verbose = TRUE; - } return (ret); } diff --git a/src/c_unixize.c b/src/c_unixize.c index b26e1e2..faee7ab 100644 --- a/src/c_unixize.c +++ b/src/c_unixize.c @@ -133,7 +133,7 @@ main og_files->filename, new_files->filename, strlen(new_files->filename) + 1 - ) != 0 || + ) != 0 && new_files->filename[0] != 0x00 ) { if (opts.verbose == TRUE) { @@ -150,7 +150,7 @@ main /* rename(); */ } } - else if (opts.rpretend == TRUE) { + else if (opts.rverbose == TRUE) { dprintf( STDOUT_FILENO, "Untouched: '%s%s'\n", diff --git a/src/c_unixize.h b/src/c_unixize.h index cba4187..fa2976f 100644 --- a/src/c_unixize.h +++ b/src/c_unixize.h @@ -61,7 +61,7 @@ struct opts_s { bool_t hyphen; bool_t preserve; bool_t pretend; - bool_t rpretend; + bool_t rverbose; bool_t recursive; bool_t verbose; char dir[MAXPATHLEN]; diff --git a/src/u_utils.c b/src/u_utils.c index b5373e5..8555710 100644 --- a/src/u_utils.c +++ b/src/u_utils.c @@ -129,7 +129,7 @@ u_get_extra_args(char args[], struct opts_s* opts) null_char += 2; i++; } - if (opts->rpretend == TRUE) { + if (opts->rverbose == TRUE) { memcpy((char*)args + (i * 2), "r:", 3 * sizeof(char)); null_char += 2; i++; @@ -179,7 +179,7 @@ u_get_nargv(struct opts_s* opts) } nargv[0][0] = C_RECURSIVE_CHAR; nargv[0][1] = 0x00; - nargv[1] = strdup("-R"); + nargv[1] = strdup("R"); nargv[2] = NULL; if (nargv[1] == NULL) { u_memdel((void*)&nargv[0]); -- cgit v1.2.3