Skip to content

Commit

Permalink
more useful exception to chop_extension
Browse files Browse the repository at this point in the history
  • Loading branch information
avsm committed May 9, 2009
1 parent a68cc5f commit fa0b606
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ let make_dirs dir =

let get_extension name =
let rec search_dot i =
if i < 1 || name.[i] = '/' then invalid_arg "Filename.chop_extension"
if i < 1 || name.[i] = '/' then invalid_arg ("Filename.chop_extension: " ^ name)
else if name.[i] = '.' then String.sub name (i+1) (String.length name - i - 1)
else search_dot (i - 1) in
search_dot (String.length name - 1)
Expand Down

0 comments on commit fa0b606

Please sign in to comment.