Parcourir la source

Fix problem with debugging of (lazy) rc_file

 + When Const.rc_file has never been evaluated, it was considered as
 unset, although it may be perfectly set.
 + Fixes be5f5e2532d216e35d47bcf142705916813e8083
Leo il y a 9 ans
Parent
commit
50ee4f4139
1 fichiers modifiés avec 3 ajouts et 4 suppressions
  1. 3 4
      src/command_def.ml

+ 3 - 4
src/command_def.ml

@@ -69,10 +69,9 @@ let shared_params =
          d (sprintf "Verbosity set to %i" !Const.verbosity);
          d (sprintf "Color %s" (match !Const.no_color with true -> "off" | false -> "on"));
          begin
-         match Lazy.is_val !Const.rc_file with
-         | false -> d "RC file will fail";
-         | true -> d (sprintf "Configuration file is %s"
-           (Lazy.force !Const.rc_file));
+         match Option.try_with (fun () -> Lazy.force !Const.rc_file) with
+         | None -> d "Configuration file will fail if used";
+         | Some rc -> d (sprintf "Configuration file is %s" rc);
          end;
          d (sprintf "Tmp file is %s" Const.tmp_file);