From 54bea1fb3953dd9b604846e5f340ab6f7fcbae89 Mon Sep 17 00:00:00 2001 From: Didier Le Botlan Date: Thu, 23 Nov 2023 12:00:32 +0100 Subject: [PATCH] =?UTF-8?q?Couper=20les=20commentaires=20et=20espaces=20si?= =?UTF-8?q?tu=C3=A9s=20apr=C3=A8s=20les=20labels=20d'arcs.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gfile.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gfile.ml b/src/gfile.ml index fed45e4..d6a53ac 100644 --- a/src/gfile.ml +++ b/src/gfile.ml @@ -66,7 +66,7 @@ let ensure graph id = if node_exists graph id then graph else new_node graph id (* Reads a line with an arc. *) let read_arc graph line = try Scanf.sscanf line "e %d %d %_d %s@%%" - (fun src tgt lbl -> new_arc (ensure (ensure graph src) tgt) { src ; tgt ; lbl } ) + (fun src tgt lbl -> let lbl = String.trim lbl in new_arc (ensure (ensure graph src) tgt) { src ; tgt ; lbl } ) with e -> Printf.printf "Cannot read arc in line - %s:\n%s\n%!" (Printexc.to_string e) line ; failwith "from_file"