Error handling for -revisions with malformed files
This commit is contained in:
parent
864ceb48f4
commit
e78d9e2373
|
@ -2994,7 +2994,11 @@ let go () =
|
||||||
| (StdIn, _, _, _, _, _)::_ -> Pdfio.input_of_channel stdin
|
| (StdIn, _, _, _, _, _)::_ -> Pdfio.input_of_channel stdin
|
||||||
| _ -> raise (Arg.Bad "Revisions: must be a filename or stdin")
|
| _ -> raise (Arg.Bad "Revisions: must be a filename or stdin")
|
||||||
in
|
in
|
||||||
|
begin try
|
||||||
Printf.printf "%i\n%!" (Pdfread.revisions input)
|
Printf.printf "%i\n%!" (Pdfread.revisions input)
|
||||||
|
with
|
||||||
|
_ -> soft_error "Malformed XRef table. Cannot determine number of revisions."
|
||||||
|
end
|
||||||
| Some Clean ->
|
| Some Clean ->
|
||||||
begin match args.out with
|
begin match args.out with
|
||||||
| (File _ | Stdout) ->
|
| (File _ | Stdout) ->
|
||||||
|
|
Loading…
Reference in New Issue