Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/btrfs_cmds.c b/btrfs_cmds.c
- index 699dfc2..ac01e02 100644
- --- a/btrfs_cmds.c
- +++ b/btrfs_cmds.c
- @@ -304,7 +304,8 @@ int do_subvol_list(int argc, char **argv)
- int ret;
- int print_parent = 0;
- char *subvol;
- - int optind = 1;
- +
- + optind = 1;
- while(1) {
- int c = getopt(argc, argv, "p");
- @@ -312,7 +313,6 @@ int do_subvol_list(int argc, char **argv)
- switch(c) {
- case 'p':
- print_parent = 1;
- - optind++;
- break;
- }
- }
- @@ -348,11 +348,13 @@ int do_subvol_list(int argc, char **argv)
- int do_clone(int argc, char **argv)
- {
- char *subvol, *dst;
- - int res, fd, fddst, len, e, optind = 0, readonly = 0;
- + int res, fd, fddst, len, e, readonly = 0;
- char *newname;
- char *dstdir;
- struct btrfs_ioctl_vol_args_v2 args;
- + optind = 1;
- +
- memset(&args, 0, sizeof(args));
- while (1) {
- @@ -362,7 +364,6 @@ int do_clone(int argc, char **argv)
- break;
- switch (c) {
- case 'r':
- - optind++;
- readonly = 1;
- break;
- default:
- @@ -378,8 +379,8 @@ int do_clone(int argc, char **argv)
- return 1;
- }
- - subvol = argv[optind+1];
- - dst = argv[optind+2];
- + subvol = argv[optind];
- + dst = argv[optind+1];
- res = test_issubvolume(subvol);
- if(res<0){
Add Comment
Please, Sign In to add comment