diff options
author | Steve Bennett <steveb@workware.net.au> | 2022-02-22 09:44:50 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2022-02-22 10:23:26 +1000 |
commit | 61b24625cd6c43b2d967b1d563f70d5b3ae8a20a (patch) | |
tree | 7b6bdcf2211315a63c16fc2eae184080b56c99da | |
parent | c5e05284a4a487f1e2a4b55ca3a62a5f7cdac9f5 (diff) | |
download | jimtcl-61b24625cd6c43b2d967b1d563f70d5b3ae8a20a.zip jimtcl-61b24625cd6c43b2d967b1d563f70d5b3ae8a20a.tar.gz jimtcl-61b24625cd6c43b2d967b1d563f70d5b3ae8a20a.tar.bz2 |
file: delete: Fix --force and --
The command line processing was wrong such that 'file delete -force abc'
would also try to delete files named 'delete' and '-force' in the current directory.
If the current directory was writable, this would succeed, but it not writable
this would fail and so the desired target was not deleted.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r-- | jim-file.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -476,8 +476,8 @@ static int file_cmd_delete(Jim_Interp *interp, int argc, Jim_Obj *const *argv) int force = Jim_CompareStringImmediate(interp, argv[0], "-force"); if (force || Jim_CompareStringImmediate(interp, argv[0], "--")) { - argc++; - argv--; + argc--; + argv++; } while (argc--) { |