Removed filename quoting for name of commmand (Windows does not like it)

This commit is contained in:
John Whitington 2019-10-24 13:15:53 +01:00
parent 3ca92575fc
commit f86760c38f
2 changed files with 6 additions and 8 deletions

View File

@ -70,7 +70,7 @@ let find_cpdflin provided =
of the cpdflin binary. Returns the exit code. *)
let call_cpdflin cpdflin temp output best_password =
let command =
Filename.quote cpdflin ^ " --linearize " ^ " --password=" ^ best_password ^ " " ^
cpdflin ^ " --linearize " ^ " --password=" ^ best_password ^ " " ^
Filename.quote temp ^ " " ^ Filename.quote output
in
match Sys.os_type with
@ -87,8 +87,8 @@ let call_cpdflin cpdflin temp output best_password =
Sys.command command
| _ ->
let command =
"DYLD_FALLBACK_LIBRARY_PATH=" ^ Filename.quote (Filename.dirname cpdflin) ^ " " ^
"LD_LIBRARY_PATH=" ^ Filename.quote (Filename.dirname cpdflin) ^ " " ^
"DYLD_FALLBACK_LIBRARY_PATH=" ^ Filename.dirname cpdflin ^ " " ^
"LD_LIBRARY_PATH=" ^ Filename.dirname cpdflin ^ " " ^
command
in
if !debug then prerr_endline command;

View File

@ -2116,7 +2116,7 @@ let embed_missing_fonts fi fo =
exit 2
end;
let gscall =
Filename.quote args.path_to_ghostscript ^
args.path_to_ghostscript ^
" -dNOPAUSE " ^ (if args.gs_quiet then "-dQUIET" else "") ^ " -sDEVICE=pdfwrite -sOUTPUTFILE=" ^ Filename.quote fo ^
" -dBATCH " ^ Filename.quote fi
in
@ -2135,7 +2135,7 @@ let mend_pdf_file_with_ghostscript filename =
let tmpout = Filename.temp_file "cpdf" ".pdf" in
tempfiles := tmpout::!tempfiles;
let gscall =
Filename.quote args.path_to_ghostscript ^
args.path_to_ghostscript ^
" -dNOPAUSE " ^ (if args.gs_quiet then "-dQUIET" else "") ^ " -sDEVICE=pdfwrite -sOUTPUTFILE=" ^ Filename.quote tmpout ^
" -dBATCH " ^ Filename.quote filename
in
@ -2734,7 +2734,6 @@ let write_image pdf resources name image =
close_out fh;
(* If pnmtopng is present, convert the pnm to a PNG. *)
begin match
(* FIXME: Use Filename.quote here *)
Sys.command ("pnmtopng -gamma 0.45 -quiet " ^ "\"" ^ name ^ ".pnm\"" ^ "> \"" ^ name ^ ".png\" 2>" ^ null_device)
with
| 0 -> Sys.remove (name ^ ".pnm")
@ -3044,7 +3043,6 @@ let startends_of_range x =
(* Calculating margins *)
let calculate_margins filename pdf (s, e) =
(* Call ghostscript *)
(* FIXME: Use Filename.quote here *)
let gscall =
args.path_to_ghostscript ^
" -dSAFER -dNOPAUSE -dBATCH -sDEVICE=bbox -r1200"
@ -4429,7 +4427,7 @@ let gs_malformed_force fi fo =
exit 2
end;
let gscall =
Filename.quote args.path_to_ghostscript ^
args.path_to_ghostscript ^
" -dNOPAUSE " ^ (if args.gs_quiet then "-dQUIET" else "") ^ " -sDEVICE=pdfwrite -sOUTPUTFILE=" ^ Filename.quote fo ^
" -dBATCH " ^ Filename.quote fi
in