Skip to content

Commit

Permalink
Fixed check of argument usability.
Browse files Browse the repository at this point in the history
The ignoreArgs map counts arguments indexed as
they are given by the OS but the normal case loop
starts to count as the index 1 which caused an
offset of the ignored arguments.
  • Loading branch information
Arkaeriit committed May 31, 2022
1 parent 8ecaaf1 commit ab204c6
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 @@ -124,7 +124,7 @@ func main() {
// normal case
ensureTrashDir()
for i, filePath := range os.Args[1:] {
if !ignoreArgs[i] {
if !ignoreArgs[i+1] {
trashFile(filePath)
}
}
Expand Down

0 comments on commit ab204c6

Please sign in to comment.