Skip to content

Commit

Permalink
Fix panic when giving non-files arguments.
Browse files Browse the repository at this point in the history
A messy indexing caused some errors.
  • Loading branch information
Arkaeriit committed Dec 15, 2022
1 parent 8c1a31f commit d59b68e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rem.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func getFilesToDelete() []string {
files := make([]string, len(os.Args)-1-len(ignoreArgs)) // -1 because of the first elem of os.Args
index := 0
for i, file := range os.Args[1:] {
if ignoreArgs[i] {
if ignoreArgs[i+1] { // +1 as i range from 0 to len(os.Args) - 2 but the keys in ignoreArgs starts at 1
continue
}
files[index] = file
Expand Down

0 comments on commit d59b68e

Please sign in to comment.