Add a function to update HEAD after creating a commit
[gitweb.git] / compat / regex / regexec.c
index 0a745d9c3b375fbfdefa3afcd021b952cef0e685..6f2b48a78bc3d8578a3a1a1e8fc28757ef2ea78b 100644 (file)
@@ -4284,7 +4284,7 @@ search_cur_bkref_entry (const re_match_context_t *mctx, int str_idx)
   last = right = mctx->nbkref_ents;
   for (left = 0; left < right;)
     {
-      mid = (left + right) / 2;
+      mid = left + (right - left) / 2;
       if (mctx->bkref_ents[mid].str_idx < str_idx)
        left = mid + 1;
       else