diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2005-02-09 13:16:36 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2005-02-09 13:16:36 +0000 |
commit | 2705253d2c78e19e44e1b7e8c6dcc220de3c82d1 (patch) | |
tree | a0c8e0a0d828a2a0089214319ef897382b77be45 /opts.c | |
parent | b31885531595665081fe79cd0e7e4ede452c1d2d (diff) | |
download | sshfs-2705253d2c78e19e44e1b7e8c6dcc220de3c82d1.tar sshfs-2705253d2c78e19e44e1b7e8c6dcc220de3c82d1.tar.gz sshfs-2705253d2c78e19e44e1b7e8c6dcc220de3c82d1.tar.bz2 sshfs-2705253d2c78e19e44e1b7e8c6dcc220de3c82d1.zip |
fix
Diffstat (limited to 'opts.c')
-rw-r--r-- | opts.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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; } - |