aboutsummaryrefslogtreecommitdiff
path: root/opts.c
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2005-02-09 13:16:36 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2005-02-09 13:16:36 +0000
commit2705253d2c78e19e44e1b7e8c6dcc220de3c82d1 (patch)
treea0c8e0a0d828a2a0089214319ef897382b77be45 /opts.c
parentb31885531595665081fe79cd0e7e4ede452c1d2d (diff)
downloadsshfs-2705253d2c78e19e44e1b7e8c6dcc220de3c82d1.tar
sshfs-2705253d2c78e19e44e1b7e8c6dcc220de3c82d1.tar.gz
sshfs-2705253d2c78e19e44e1b7e8c6dcc220de3c82d1.tar.bz2
sshfs-2705253d2c78e19e44e1b7e8c6dcc220de3c82d1.zip
fix
Diffstat (limited to 'opts.c')
-rw-r--r--opts.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/opts.c b/opts.c
index 3e3e34a..ab39f36 100644
--- a/opts.c
+++ b/opts.c
@@ -83,12 +83,17 @@ void process_options(int *argcp, char *argv[], struct opt opts[],
argctr++;
arg = argv[argctr];
removed = process_option_group(arg, opts, case_sensitive);
- if (!removed && argctr != newargctr)
+ if (removed)
+ free(argv[argctr-1]);
+ else if (argctr != newargctr)
argv[newargctr++] = argv[argctr-1];
+
}
}
}
- if (!removed) {
+ if (removed)
+ free(arg);
+ else {
if(argctr != newargctr)
argv[newargctr] = arg;
newargctr++;
@@ -96,4 +101,3 @@ void process_options(int *argcp, char *argv[], struct opt opts[],
}
*argcp = newargctr;
}
-