aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjozan <jozan@noemail.net>2020-11-08 00:45:12 +0000
committerjozan <jozan@noemail.net>2020-11-08 00:45:12 +0000
commit8c5398b30702841af07585337524bd98f517c2c6 (patch)
tree49bf677872e3713761fd0320a2445138a02834a2
parentAdded relative path nice (diff)
downloadunixize-8c5398b30702841af07585337524bd98f517c2c6.tar.gz
unixize-8c5398b30702841af07585337524bd98f517c2c6.tar.bz2
unixize-8c5398b30702841af07585337524bd98f517c2c6.tar.xz
unixize-8c5398b30702841af07585337524bd98f517c2c6.tar.zst
unixize-8c5398b30702841af07585337524bd98f517c2c6.zip
Nice format, now subst
FossilOrigin-Name: eaf78ce2c06ccc13c08d75862ac845dda080a43c548eb97093d69309d9b949a0
-rw-r--r--src/c_unixize.c34
1 files 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;