Parcourir la source

Commands where launched twice

We were waiting to get 2 in tmp file, so all commands where launched once and
then once again.

After first time, tmp file was:
{
  "rc": [
    ("rc-file-name",
     ([
      { "commands": ("cmd1", 1) },
      ...
      { "commands": ("cmdN", 1) }
     ]))
  ],
    "daemon": 0
}

(we now stop here)
---------------------------------------

After the second bunch of launch
{
  "rc": [
    ("rc-file-name",
     ([
      { "commands": ("cmd1", 2) },
      ...
      { "commands": ("cmdN", 2) }
     ]))
  ],
    "daemon": 0
}
Leo il y a 9 ans
Parent
commit
2fafeae271
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      src/exec_cmd.ml

+ 1 - 1
src/exec_cmd.ml

@@ -54,7 +54,7 @@ let less_launched (log : (string * int) list) =
   let entries_by_number = List.Assoc.inverse log  in
   let entries_by_number = List.Assoc.inverse log  in
     List.min_elt ~cmp:(fun (n,_) (n',_) -> Int.compare n n') entries_by_number
     List.min_elt ~cmp:(fun (n,_) (n',_) -> Int.compare n n') entries_by_number
     |> (function Some (min,cmd) ->
     |> (function Some (min,cmd) ->
-        if min <= max
+        if min < max
         then Some cmd
         then Some cmd
         else None
         else None
       | None -> assert false) (* XXX Use exception here? *)
       | None -> assert false) (* XXX Use exception here? *)