From 1da809c59639f2dcf71e2aa2749946cb26062a70 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Mon, 30 Mar 2015 11:53:55 +0200 Subject: [PATCH] fix CCUnix.escape_str --- src/unix/CCUnix.ml | 4 ++-- src/unix/CCUnix.mli | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/unix/CCUnix.ml b/src/unix/CCUnix.ml index 238ef0c2..ec739f0f 100644 --- a/src/unix/CCUnix.ml +++ b/src/unix/CCUnix.ml @@ -50,7 +50,7 @@ let rec iter_gen f g = match g() with (* print a string, but escaped if required *) let escape_str buf s = if str_exists s - (function ' ' | '"' | '\'' -> true | _ -> false) + (function ' ' | '"' | '\'' | '\n' | '\t'-> true | _ -> false) then ( Buffer.add_char buf '\''; String.iter @@ -79,7 +79,7 @@ let read_all ?(size=1024) ic = with Exit -> Bytes.sub_string !buf 0 !len -type call_result = +type call_result = < stdout:string; stderr:string; status:Unix.process_status; diff --git a/src/unix/CCUnix.mli b/src/unix/CCUnix.mli index a4f037d0..59c9958a 100644 --- a/src/unix/CCUnix.mli +++ b/src/unix/CCUnix.mli @@ -45,7 +45,7 @@ val escape_str : Buffer.t -> string -> unit CCPrint.sprintf "%a" escape_str "fo'o b'ar" = "'fo''o b''ar'" *) -type call_result = +type call_result = < stdout:string; stderr:string; status:Unix.process_status;