Skip to content

Commit

Permalink
Merge pull request #2187 from floriangit/rm_unused_code_cp
Browse files Browse the repository at this point in the history
remove opt_nocopyzero setting globally, since unused
  • Loading branch information
ghaerr authored Jan 19, 2025
2 parents 46e8834 + 446ddcf commit 1fb2a47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
12 changes: 6 additions & 6 deletions elks/tools/mfs/mkfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ void parse_mkfs(int argc,char **argv,int *magic_p,int *nblks_p,int *inodes_p) {
case 's':
*nblks_p = atoi(optarg);
break;
case 'k':
opt_nocopyzero = 1;
break;
case 'a':
opt_appendifexists = 1;
break;
case 'k':
opt_nocopyzero = 1;
break;
case 'a':
opt_appendifexists = 1;
break;
default:
usage(argv[0]);
}
Expand Down
9 changes: 0 additions & 9 deletions elkscmd/file_utils/cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

int opt_recurse; /* implicitly initialized */
int opt_verbose;
int opt_nocopyzero;
int opt_force;
int whole_disk_copy;
char *destination_dir;
Expand Down Expand Up @@ -329,14 +328,6 @@ static int do_copies(void)

err |= do_mkdir(inode_build->path, destdir(inode_build->path));
} else if (flags == S_IFREG) {
if (opt_nocopyzero && !inode_build->blocks) {
char *p = strrchr(inode_build->path, '/');
if (p && *++p == '.') {
if (opt_verbose)
printf("Skipping zero length %s\n", inode_build->path);
continue;
}
}

err |= do_cp(inode_build->path, destdir(inode_build->path));
} else if (flags == S_IFCHR) {
Expand Down

0 comments on commit 1fb2a47

Please sign in to comment.