From 8c5398b30702841af07585337524bd98f517c2c6 Mon Sep 17 00:00:00 2001 From: jozan Date: Sun, 8 Nov 2020 00:45:12 +0000 Subject: Nice format, now subst FossilOrigin-Name: eaf78ce2c06ccc13c08d75862ac845dda080a43c548eb97093d69309d9b949a0 --- src/c_unixize.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/src/c_unixize.c b/src/c_unixize.c index 15bfccf..1e604d8 100644 --- a/src/c_unixize.c +++ b/src/c_unixize.c @@ -64,10 +64,10 @@ main (int argc, const char* argv[]) { - struct lfiles_s* og_files; struct lfiles_s* new_files; - struct lfiles_s* og_files_head; struct lfiles_s* new_files_head; + struct lfiles_s* og_files; + struct lfiles_s* og_files_head; struct opts_s opts; int nargc; char** nargv; @@ -126,18 +126,26 @@ main u_decrease_subpath(subpath); } } - if (opts.verbose == TRUE) { - dprintf( - STDOUT_FILENO, - "'%s%s' -> '%s%s'\n", - subpath, + if ( + strncmp( og_files->filename, - subpath, - new_files->filename - ); - } - if (opts.pretend == FALSE) { - /* rename(); */ + new_files->filename, + strlen(new_files->filename) + 1 + ) == 0 + ) { + if (opts.verbose == TRUE) { + dprintf( + STDOUT_FILENO, + "'%s%s' -> '%s%s'\n", + subpath, + og_files->filename, + subpath, + new_files->filename + ); + } + if (opts.pretend == FALSE) { + /* rename(); */ + } } og_files = og_files->next; new_files = new_files->next; -- cgit v1.2.3