Skip to content

Commit

Permalink
Don't specify period ('.') in extension list
Browse files Browse the repository at this point in the history
Filename.extension returns the leading period. The former
get_extension function did not. Fixes a regression in 3.3.0.
  • Loading branch information
MisterDA authored and hannesm committed Aug 5, 2022
1 parent 5781fba commit bd4f019
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v3.3.1 (2022-08-05)

* Fixed a regression in v3.3.0 where periods ('.') had to be specified
in the extention list. (#62, @MisterDA, fixes #61 reported by @cemerick)

## v3.3.0 (2022-07-24)

* Open files in binary mode so buffers don't underread on Windows.
Expand Down
4 changes: 3 additions & 1 deletion src/crunch.ml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ let walk_directory_tree t exts walkfn root_dir =
(* If extension list is empty then let all through, otherwise white list *)
match (exts, Filename.extension f) with
| [], _ -> repeat (walkfn t root_dir name)
| exts, e when e <> "" && List.mem e exts ->
| exts, e
when e <> ""
&& List.mem (String.sub e 1 (String.length e - 1)) exts ->
repeat (walkfn t root_dir name)
| _ -> repeat t)
in
Expand Down

0 comments on commit bd4f019

Please sign in to comment.