aboutsummaryrefslogtreecommitdiff
path: root/jim-file.c
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2022-02-22 09:44:50 +1000
committerSteve Bennett <steveb@workware.net.au>2022-02-22 10:23:26 +1000
commit61b24625cd6c43b2d967b1d563f70d5b3ae8a20a (patch)
tree7b6bdcf2211315a63c16fc2eae184080b56c99da /jim-file.c
parentc5e05284a4a487f1e2a4b55ca3a62a5f7cdac9f5 (diff)
downloadjimtcl-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>
Diffstat (limited to 'jim-file.c')
-rw-r--r--jim-file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/jim-file.c b/jim-file.c
index 56fb314..5532cb4 100644
--- a/jim-file.c
+++ b/jim-file.c
@@ -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--) {