ronantakizawa/codereview-bench huggingface dataset:
Repository: neovim/neovim
File: src/nvim/change.c (C)

Code before:
      // Wait two seconds, to make sure the user reads this unexpected
      // message.  Since we could be anywhere, call wait_return() now,
      // and don't let the emsg() set msg_scroll.
      if (need_wait_return && emsg_silent == 0) {
        ui_flush();
        os_delay(2000L, true);
        wait_return(true);
        msg_scroll = save_msg_scroll;
      } else {
        need_wait_return = save_need_wait_return;
      }
    }
    changed_internal();
  }
  buf_inc_changedtick(curbuf);

  // If a pattern is highlighted, the position may now be invalid.
  highlight_match = false;
}

/// Internal part of changed(), no user interaction.
/// Also used for recovery.
void changed_internal(void)
{
  curbuf->b_changed = true;
  curbuf->b_changed_notified = false;
  ml_setflags(curbuf);
  check_status(curbuf);
  redraw_tabline = true;
  need_maketitle = true;  // set window title later
}

/// Common code for when a change was made.
/// See changed_lines() for the arguments.
/// Careful: may trigger autocommands that reload the buffer.
static void changed_common(linenr_T lnum, colnr_T col, linenr_T lnume,
                           long xtra)
{
  int i;
  pos_T       *p;
  int add;

  // mark the buffer as modified
  changed();

  if (curwin->w_p_diff && diff_internal()) {
    curtab->tp_diff_update = true;
  }

  // set the '. mark
  if (!cmdmod.keepjumps) {

Review comment (suggestion):
Usually we prefer invalidiation flags to be the other way around, i e a flag that is `true` if a later action is needed.

Code after:
      // Wait two seconds, to make sure the user reads this unexpected
      // message.  Since we could be anywhere, call wait_return() now,
      // and don't let the emsg() set msg_scroll.
      if (need_wait_return && emsg_silent == 0) {
        ui_flush();
        os_delay(2000L, true);
        wait_return(true);
        msg_scroll = save_msg_scroll;
      } else {
        need_wait_return = save_need_wait_return;
      }
    }
    changed_internal();
  }
  buf_inc_changedtick(curbuf);

  // If a pattern is highlighted, the position may now be invalid.
  highlight_match = false;
}

/// Internal part of changed(), no user interaction.
/// Also used for recovery.
void changed_internal(void)
{
  curbuf->b_changed = true;
  curbuf->b_changed_invalid = true;
  ml_setflags(curbuf);
  check_status(curbuf);
  redraw_tabline = true;
  need_maketitle = true;  // set window title later
}

/// Common code for when a change was made.
/// See changed_lines() for the arguments.
/// Careful: may trigger autocommands that reload the buffer.
static void changed_common(linenr_T lnum, colnr_T col, linenr_T lnume,
                           long xtra)
{
  int i;
  pos_T       *p;
  int add;

  // mark the buffer as modified
  changed();

  if (curwin->w_p_diff && diff_internal()) {
    curtab->tp_diff_update = true;
  }

  // set the '. mark
  if (!cmdmod.keepjumps) {
Repository: neovim/neovim
File: src/nvim/ex_docmd.c (C)

Code before:
  int bad_char_idx;

  // ":edit ++[no]bin[ary] file"
  if (STRNCMP(arg, "bin", 3) == 0 || STRNCMP(arg, "nobin", 5) == 0) {
    if (*arg == 'n') {
      arg += 2;
      eap->force_bin = FORCE_NOBIN;
    } else {
      eap->force_bin = FORCE_BIN;
    }
    if (!checkforcmd(&arg, "binary", 3)) {
      return FAIL;
    }
    eap->arg = skipwhite(arg);
    return OK;
  }

  // ":read ++edit file"
  if (STRNCMP(arg, "edit", 4) == 0) {
    eap->read_edit = true;
    eap->arg = skipwhite(arg + 4);
    return OK;
  }

  // ":write ++p foo/bar/file
  if (STRNCMP(arg, "p", 1) == 0) {
    eap->mkdir_p = true;
    eap->arg = skipwhite(arg + 1);
    return OK;
  }

  if (STRNCMP(arg, "ff", 2) == 0) {
    arg += 2;
    pp = &eap->force_ff;
  } else if (STRNCMP(arg, "fileformat", 10) == 0) {
    arg += 10;
    pp = &eap->force_ff;
  } else if (STRNCMP(arg, "enc", 3) == 0) {
    if (STRNCMP(arg, "encoding", 8) == 0) {
      arg += 8;
    } else {
      arg += 3;
    }
    pp = &eap->force_enc;
  } else if (STRNCMP(arg, "bad", 3) == 0) {
    arg += 3;
    pp = &bad_char_idx;
  }

  if (pp == NULL || *arg != '=') {
    return FAIL;

Review comment (suggestion):
```suggestion
  if (strncmp(arg, "p", 1) == 0) {
```

Code after:
  int bad_char_idx;

  // ":edit ++[no]bin[ary] file"
  if (STRNCMP(arg, "bin", 3) == 0 || STRNCMP(arg, "nobin", 5) == 0) {
    if (*arg == 'n') {
      arg += 2;
      eap->force_bin = FORCE_NOBIN;
    } else {
      eap->force_bin = FORCE_BIN;
    }
    if (!checkforcmd(&arg, "binary", 3)) {
      return FAIL;
    }
    eap->arg = skipwhite(arg);
    return OK;
  }

  // ":read ++edit file"
  if (STRNCMP(arg, "edit", 4) == 0) {
    eap->read_edit = true;
    eap->arg = skipwhite(arg + 4);
    return OK;
  }

  // ":write ++p foo/bar/file
  if (strncmp(arg, "p", 1) == 0) {
    eap->mkdir_p = true;
    eap->arg = skipwhite(arg + 1);
    return OK;
  }

  if (STRNCMP(arg, "ff", 2) == 0) {
    arg += 2;
    pp = &eap->force_ff;
  } else if (STRNCMP(arg, "fileformat", 10) == 0) {
    arg += 10;
    pp = &eap->force_ff;
  } else if (STRNCMP(arg, "enc", 3) == 0) {
    if (STRNCMP(arg, "encoding", 8) == 0) {
      arg += 8;
    } else {
      arg += 3;
    }
    pp = &eap->force_enc;
  } else if (STRNCMP(arg, "bad", 3) == 0) {
    arg += 3;
    pp = &bad_char_idx;
  }

  if (pp == NULL || *arg != '=') {
    return FAIL;
Repository: neovim/neovim
File: src/nvim/os/fs.c (C)

Code before:
      *past_head = past_head_save;
    }
    const size_t component_len = strlen(e);
    e += component_len;
    if (e == real_end
        && memcnt(e - component_len, PATHSEP, component_len) == component_len) {
      // Path ends with something like "////". Ignore this.
      break;
    }
    int ret;
    if ((ret = os_mkdir(curdir, mode)) != 0) {
      *failed_dir = curdir;
      return ret;
    }
  }
  xfree(curdir);
  return 0;
}

/// Create the parent directory of a file if it does not exist
///
/// @param[in] fname Full path of the file name whose parent directories
///                  we want to create
///
/// @return `0` for success, libuv error code for failure.
int os_mkdir_if_absent(char *fname)
  FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
{
  if (!dir_of_file_exists((char_u *)fname)) {
    char *tail = path_tail_with_sep(fname);
    char c = *tail;
    *tail = NUL;
    int r;
    char *failed_dir;
    if ((r = os_mkdir_recurse(fname, 0755, &failed_dir) < 0)) {
      semsg(_(e_mkdir), failed_dir, os_strerror(r));
      xfree(failed_dir);
    }
    *tail = c;
    return r;
  }
  return 0;
}

/// Create a unique temporary directory.
///
/// @param[in] template Template of the path to the directory with XXXXXX
///                     which would be replaced by random chars.
/// @param[out] path Path to created directory for success, undefined for
///                  failure.
/// @return `0` for success, non-zero for failure.

Review comment (suggestion):
Trying to think of a more conventional name. Could do something like `os_file_ensure_dir` but I think this works:

```suggestion
int os_file_mkdir(char *fname)
```

Code after:
      *past_head = past_head_save;
    }
    const size_t component_len = strlen(e);
    e += component_len;
    if (e == real_end
        && memcnt(e - component_len, PATHSEP, component_len) == component_len) {
      // Path ends with something like "////". Ignore this.
      break;
    }
    int ret;
    if ((ret = os_mkdir(curdir, mode)) != 0) {
      *failed_dir = curdir;
      return ret;
    }
  }
  xfree(curdir);
  return 0;
}

/// Create the parent directory of a file if it does not exist
///
/// @param[in] fname Full path of the file name whose parent directories
///                  we want to create
/// @param[in] mode  Permissions for the newly-created directory.
///
/// @return `0` for success, libuv error code for failure.
int os_file_mkdir(char *fname, int32_t mode)
  FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
{
  if (!dir_of_file_exists((char_u *)fname)) {
    char *tail = path_tail_with_sep(fname);
    char *last_char = tail + strlen(tail) - 1;
    if (vim_ispathsep(*last_char)) {
      emsg(_(e_noname));
      return -1;
    }
    char c = *tail;
    *tail = NUL;
    int r;
    char *failed_dir;
    if ((r = os_mkdir_recurse(fname, mode, &failed_dir) < 0)) {
      semsg(_(e_mkdir), failed_dir, os_strerror(r));
      xfree(failed_dir);
    }
    *tail = c;
    return r;
  }
  return 0;
}

/// Create a unique temporary directory.
Repository: neovim/neovim
File: test/busted_runner.lua (Lua)

Code before:
local platform = vim.uv.os_uname()
local deps_install_dir = os.getenv 'DEPS_INSTALL_DIR'
local suffix = (platform and platform.sysname:lower():find'windows') and '.dll' or '.so'
package.path = deps_install_dir.."/share/lua/5.1/?.lua;"..deps_install_dir.."/share/lua/5.1/?/init.lua;"..package.path
package.cpath = deps_install_dir.."/lib/lua/5.1/?"..suffix..";"..package.cpath;

local uv = vim.loop

local system = {}
package.loaded['system.core'] = system
function system.monotime()
  uv.update_time()
  return uv.now()*1e-3
end
function system.gettime()
  local sec, usec = uv.gettimeofday()
  return sec+usec*1e-6
end
function system.sleep(sec)
  uv.sleep(sec*1e3)
end

local term = {}
package.loaded['term.core'] = term
function term.isatty(_)
  return uv.guess_handle(1) == 'tty'
end

local lfs = {}
package.loaded['lfs'] = lfs

function lfs.attributes(path, attr)

Review comment (suggestion):
```suggestion
local uv = vim.uv
```

(unless we want to backport)

Code after:
local platform = vim.uv.os_uname()
local deps_install_dir = os.getenv 'DEPS_INSTALL_DIR'
local suffix = (platform and platform.sysname:lower():find'windows') and '.dll' or '.so'
package.path = deps_install_dir.."/share/lua/5.1/?.lua;"..deps_install_dir.."/share/lua/5.1/?/init.lua;"..package.path
package.cpath = deps_install_dir.."/lib/lua/5.1/?"..suffix..";"..package.cpath;

local uv = vim.uv

local system = {}
package.loaded['system.core'] = system
function system.monotime()
  uv.update_time()
  return uv.now()*1e-3
end
function system.gettime()
  local sec, usec = uv.gettimeofday()
  return sec+usec*1e-6
end
function system.sleep(sec)
  uv.sleep(sec*1e3)
end

local term = {}
package.loaded['term.core'] = term
function term.isatty(_)
  return uv.guess_handle(1) == 'tty'
end

local lfs = {}
package.loaded['lfs'] = lfs

function lfs.attributes(path, attr)
Repository: neovim/neovim
File: test/busted_runner.lua (Lua)

Code before:
package.loaded['lfs'] = lfs

function lfs.attributes(path, attr)
  if attr == 'mode' then
    local stat = uv.fs_stat(path)
    return stat and stat.type or ''
  else
    error('not implemented')
  end
end

function lfs.currentdir()
  return uv.cwd()
end

function lfs.chdir(dir)
  local status, _ = pcall(uv.chdir, dir)
  if status then
    return true
  else
    return unpack(status)
  end
end

function lfs.dir(path)
  local fs = vim.loop.fs_scandir(path)
  return function()
    if not fs then
      return
    end
    return vim.loop.fs_scandir_next(fs)
  end
end

require 'busted.runner'({ standalone = false })


Review comment (suggestion):
```suggestion
  local fs = uv.fs_scandir(path)
```

Code after:
package.loaded['lfs'] = lfs

function lfs.attributes(path, attr)
  if attr == 'mode' then
    local stat = uv.fs_stat(path)
    return stat and stat.type or ''
  else
    error('not implemented')
  end
end

function lfs.currentdir()
  return uv.cwd()
end

function lfs.chdir(dir)
  local status, err = pcall(uv.chdir, dir)
  if status then
    return true
  else
    return nil, err
  end
end

function lfs.dir(path)
  local fs = uv.fs_scandir(path)
  return function()
    if not fs then
      return
    end
    return uv.fs_scandir_next(fs)
  end
end

require 'busted.runner'({ standalone = false })
Repository: neovim/neovim
File: test/busted_runner.lua (Lua)

Code before:
    return stat and stat.type or ''
  else
    error('not implemented')
  end
end

function lfs.currentdir()
  return uv.cwd()
end

function lfs.chdir(dir)
  local status, _ = pcall(uv.chdir, dir)
  if status then
    return true
  else
    return unpack(status)
  end
end

function lfs.dir(path)
  local fs = vim.loop.fs_scandir(path)
  return function()
    if not fs then
      return
    end
    return vim.loop.fs_scandir_next(fs)
  end
end

require 'busted.runner'({ standalone = false })


Review comment (suggestion):
```suggestion
    return uv.fs_scandir_next(fs)
```

Code after:
    return stat and stat.type or ''
  else
    error('not implemented')
  end
end

function lfs.currentdir()
  return uv.cwd()
end

function lfs.chdir(dir)
  local status, err = pcall(uv.chdir, dir)
  if status then
    return true
  else
    return nil, err
  end
end

function lfs.dir(path)
  local fs = uv.fs_scandir(path)
  return function()
    if not fs then
      return
    end
    return uv.fs_scandir_next(fs)
  end
end

require 'busted.runner'({ standalone = false })
Repository: neovim/neovim
File: src/nvim/api/command.c (C)

Code before:
      goto end;
    });
  }

  // Finally, build the command line string that will be stored inside ea.cmdlinep.
  // This also sets the values of ea.cmd, ea.arg, ea.args and ea.arglens.
  build_cmdline_str(&cmdline, &ea, &cmdinfo, args);
  ea.cmdlinep = &cmdline;

  // set when Not Implemented
  const int ni = is_cmd_ni(ea.cmdidx);

  // Check for "++opt=val" argument.
  if (ea.argt & EX_ARGOPT) {
    while (ea.arg[0] == '+' && ea.arg[1] == '+') {
      if (getargopt(&ea) == FAIL && !ni) {
        api_set_error(err, kErrorTypeValidation, "Invalid argument");
        goto end;
      }
    }
  }

  // Check for "+command" argument.
  if ((ea.argt & EX_CMDARG) && !ea.usefilter) {
    ea.do_ecmd_cmd = getargcmd(&ea.arg);
  }

  garray_T capture_local;
  const int save_msg_silent = msg_silent;
  garray_T * const save_capture_ga = capture_ga;
  const int save_msg_col = msg_col;

  if (opts->output) {
    ga_init(&capture_local, 1, 80);
    capture_ga = &capture_local;
  }

  TRY_WRAP(err, {
    if (opts->output) {
      msg_silent++;
      msg_col = 0;  // prevent leading spaces
    }

    WITH_SCRIPT_CONTEXT(channel_id, {
      execute_cmd(&ea, &cmdinfo, false);
    });

    if (opts->output) {
      capture_ga = save_capture_ga;
      msg_silent = save_msg_silent;
      // Put msg_col back where it was, since nothing should have been written.

Review comment (suggestion):
Should this be done in `execute_cmd()` instead? That'll also allow keeping the two functions as static.

Code after:
             "%s", "Command cannot be run in sandbox", {
      goto end;
    });
  }

  // Finally, build the command line string that will be stored inside ea.cmdlinep.
  // This also sets the values of ea.cmd, ea.arg, ea.args and ea.arglens.
  build_cmdline_str(&cmdline, &ea, &cmdinfo, args);
  ea.cmdlinep = &cmdline;

  // Check for "++opt=val" argument.
  if (ea.argt & EX_ARGOPT) {
    while (ea.arg[0] == '+' && ea.arg[1] == '+') {
      char *orig_arg = ea.arg;
      int result = getargopt(&ea);
      VALIDATE_S(result != FAIL || is_cmd_ni(ea.cmdidx), "argument ", orig_arg, {
        goto end;
      });
    }
  }

  // Check for "+command" argument.
  if ((ea.argt & EX_CMDARG) && !ea.usefilter) {
    ea.do_ecmd_cmd = getargcmd(&ea.arg);
  }

  garray_T capture_local;
  const int save_msg_silent = msg_silent;
  garray_T * const save_capture_ga = capture_ga;
  const int save_msg_col = msg_col;

  if (opts->output) {
    ga_init(&capture_local, 1, 80);
    capture_ga = &capture_local;
  }

  TRY_WRAP(err, {
    if (opts->output) {
      msg_silent++;
      msg_col = 0;  // prevent leading spaces
    }

    WITH_SCRIPT_CONTEXT(channel_id, {
      execute_cmd(&ea, &cmdinfo, false);
    });

    if (opts->output) {
      capture_ga = save_capture_ga;
      msg_silent = save_msg_silent;
      // Put msg_col back where it was, since nothing should have been written.
      msg_col = save_msg_col;
Repository: neovim/neovim
File: src/nvim/api/command.c (C)

Code before:
             "%s", "Command cannot be run in sandbox", {
      goto end;
    });
  }

  // Finally, build the command line string that will be stored inside ea.cmdlinep.
  // This also sets the values of ea.cmd, ea.arg, ea.args and ea.arglens.
  build_cmdline_str(&cmdline, &ea, &cmdinfo, args);
  ea.cmdlinep = &cmdline;

  // set when Not Implemented
  const int ni = is_cmd_ni(ea.cmdidx);

  // Check for "++opt=val" argument.
  if (ea.argt & EX_ARGOPT) {
    while (ea.arg[0] == '+' && ea.arg[1] == '+') {
      if (getargopt(&ea) == FAIL && !ni) {
        api_set_error(err, kErrorTypeValidation, "Invalid argument");
        goto end;
      }
    }
  }

  // Check for "+command" argument.
  if ((ea.argt & EX_CMDARG) && !ea.usefilter) {
    ea.do_ecmd_cmd = getargcmd(&ea.arg);
  }

  garray_T capture_local;
  const int save_msg_silent = msg_silent;
  garray_T * const save_capture_ga = capture_ga;
  const int save_msg_col = msg_col;

  if (opts->output) {
    ga_init(&capture_local, 1, 80);
    capture_ga = &capture_local;
  }

  TRY_WRAP(err, {
    if (opts->output) {
      msg_silent++;
      msg_col = 0;  // prevent leading spaces
    }

    WITH_SCRIPT_CONTEXT(channel_id, {
      execute_cmd(&ea, &cmdinfo, false);
    });

    if (opts->output) {
      capture_ga = save_capture_ga;
      msg_silent = save_msg_silent;

Review comment (refactor):
Would it be possible to move this code from here and `do_one_cmd` to `execute_cmd0` so there isn't any code duplication?

Code after:
    VALIDATE(!((cmdinfo.cmdmod.cmod_flags & CMOD_SANDBOX) && !(ea.argt & EX_SBOXOK)),
             "%s", "Command cannot be run in sandbox", {
      goto end;
    });
  }

  // Finally, build the command line string that will be stored inside ea.cmdlinep.
  // This also sets the values of ea.cmd, ea.arg, ea.args and ea.arglens.
  build_cmdline_str(&cmdline, &ea, &cmdinfo, args);
  ea.cmdlinep = &cmdline;

  // Check for "++opt=val" argument.
  if (ea.argt & EX_ARGOPT) {
    while (ea.arg[0] == '+' && ea.arg[1] == '+') {
      char *orig_arg = ea.arg;
      int result = getargopt(&ea);
      VALIDATE_S(result != FAIL || is_cmd_ni(ea.cmdidx), "argument ", orig_arg, {
        goto end;
      });
    }
  }

  // Check for "+command" argument.
  if ((ea.argt & EX_CMDARG) && !ea.usefilter) {
    ea.do_ecmd_cmd = getargcmd(&ea.arg);
  }

  garray_T capture_local;
  const int save_msg_silent = msg_silent;
  garray_T * const save_capture_ga = capture_ga;
  const int save_msg_col = msg_col;

  if (opts->output) {
    ga_init(&capture_local, 1, 80);
    capture_ga = &capture_local;
  }

  TRY_WRAP(err, {
    if (opts->output) {
      msg_silent++;
      msg_col = 0;  // prevent leading spaces
    }

    WITH_SCRIPT_CONTEXT(channel_id, {
      execute_cmd(&ea, &cmdinfo, false);
    });

    if (opts->output) {
      capture_ga = save_capture_ga;
      msg_silent = save_msg_silent;
      // Put msg_col back where it was, since nothing should have been written.
Repository: neovim/neovim
File: src/nvim/ui.c (C)

Code before:
} UIEventCallback;

#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "ui.c.generated.h"
#endif

#define MAX_UI_COUNT 16

static RemoteUI *uis[MAX_UI_COUNT];
static bool ui_ext[kUIExtCount] = { 0 };
static size_t ui_count = 0;
static int ui_mode_idx = SHAPE_IDX_N;
static int cursor_row = 0, cursor_col = 0;
static bool pending_cursor_update = false;
static int busy = 0;
static bool pending_mode_info_update = false;
static bool pending_mode_update = false;
static handle_T cursor_grid_handle = DEFAULT_GRID_HANDLE;

static PMap(uint32_t) ui_event_cbs = MAP_INIT;
bool ui_cb_ext[kUIExtCount];  ///< Internalized UI capabilities.

static bool has_mouse = false;
static int pending_has_mouse = -1;
static bool pending_default_colors = false;
static bool was_busy = false;

#ifdef NVIM_LOG_DEBUG
static size_t uilog_seen = 0;
static const char *uilog_last_event = NULL;

static void ui_log(const char *funname)
{
# ifdef EXITFREE
  if (entered_free_all_mem) {
    return;  // do nothing, we cannot log now
  }
# endif

  if (uilog_last_event == funname) {
    uilog_seen++;
  } else {
    if (uilog_seen > 0) {
      logmsg(LOGLVL_DBG, "UI: ", NULL, -1, true,
             "%s (+%zu times...)", uilog_last_event, uilog_seen);
    }
    logmsg(LOGLVL_DBG, "UI: ", NULL, -1, true, "%s", funname);
    uilog_seen = 0;
    uilog_last_event = funname;
  }
}

Review comment (suggestion):
only `ui_flush` uses this so it should be defined in that scope.

Code after:
  bool ext_widgets[kUIGlobalCount];
} UIEventCallback;

#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "ui.c.generated.h"
#endif

#define MAX_UI_COUNT 16

static RemoteUI *uis[MAX_UI_COUNT];
static bool ui_ext[kUIExtCount] = { 0 };
static size_t ui_count = 0;
static int ui_mode_idx = SHAPE_IDX_N;
static int cursor_row = 0, cursor_col = 0;
static bool pending_cursor_update = false;
static int busy = 0;
static bool pending_mode_info_update = false;
static bool pending_mode_update = false;
static handle_T cursor_grid_handle = DEFAULT_GRID_HANDLE;

static PMap(uint32_t) ui_event_cbs = MAP_INIT;
bool ui_cb_ext[kUIExtCount];  ///< Internalized UI capabilities.

static bool has_mouse = false;
static int pending_has_mouse = -1;
static bool pending_default_colors = false;

#ifdef NVIM_LOG_DEBUG
static size_t uilog_seen = 0;
static const char *uilog_last_event = NULL;

static void ui_log(const char *funname)
{
# ifdef EXITFREE
  if (entered_free_all_mem) {
    return;  // do nothing, we cannot log now
  }
# endif

  if (uilog_last_event == funname) {
    uilog_seen++;
  } else {
    if (uilog_seen > 0) {
      logmsg(LOGLVL_DBG, "UI: ", NULL, -1, true,
             "%s (+%zu times...)", uilog_last_event, uilog_seen);
    }
    logmsg(LOGLVL_DBG, "UI: ", NULL, -1, true, "%s", funname);
    uilog_seen = 0;
    uilog_last_event = funname;
  }
}