From 61b24625cd6c43b2d967b1d563f70d5b3ae8a20a Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Tue, 22 Feb 2022 09:44:50 +1000 Subject: 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 --- jim-file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'jim-file.c') 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--) { -- cgit v1.1