aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/shell.c
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2016-05-30 20:55:29 +0300
committerZyX <kp-pav@yandex.ru>2016-05-30 20:58:15 +0300
commit77540a04582927e842c7d5522bb862756da2cbba (patch)
treeaa9f9ef561e5b2a165cb3e1c092b39be87973925 /src/nvim/os/shell.c
parent748898b4dd992c5a5d15a0e1f9f047fc42ba4fd3 (diff)
downloadrneovim-77540a04582927e842c7d5522bb862756da2cbba.tar.gz
rneovim-77540a04582927e842c7d5522bb862756da2cbba.tar.bz2
rneovim-77540a04582927e842c7d5522bb862756da2cbba.zip
*: Rename main loop variable from loop to main_loop
Current name is inappropriate for the following reasons: 1. It is often masked by local `loop` variables. 2. It cannot be searched for. There are many `loop` variables where `loop` is some local variable. There are many cases when “loop” word is used in a comment. 3. It is in any case bad idea to use a generic name as a name of the global variable. Best if global has module prefix: this is why it is in `main.h`: `main_loop` both stands for “a main loop” and “a loop defined in `main.*`”. Since I have no idea how to list every occurrence of this variable method used to rename it is “remove it from globals.h, try to compile, fix errors”. Thus if some occurrence was hidden under false `#if` branch it was not replaced.
Diffstat (limited to 'src/nvim/os/shell.c')
-rw-r--r--src/nvim/os/shell.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c
index f5a1637c94..988620b145 100644
--- a/src/nvim/os/shell.c
+++ b/src/nvim/os/shell.c
@@ -14,6 +14,7 @@
#include "nvim/os/shell.h"
#include "nvim/os/signal.h"
#include "nvim/types.h"
+#include "nvim/main.h"
#include "nvim/vim.h"
#include "nvim/message.h"
#include "nvim/memory.h"
@@ -205,16 +206,16 @@ static int do_os_system(char **argv,
xstrlcpy(prog, argv[0], MAXPATHL);
Stream in, out, err;
- LibuvProcess uvproc = libuv_process_init(&loop, &buf);
+ LibuvProcess uvproc = libuv_process_init(&main_loop, &buf);
Process *proc = &uvproc.process;
- Queue *events = queue_new_child(loop.events);
+ Queue *events = queue_new_child(main_loop.events);
proc->events = events;
proc->argv = argv;
proc->in = input != NULL ? &in : NULL;
proc->out = &out;
proc->err = &err;
if (!process_spawn(proc)) {
- loop_poll_events(&loop, 0);
+ loop_poll_events(&main_loop, 0);
// Failed, probably due to `sh` not being executable
if (!silent) {
MSG_PUTS(_("\nCannot execute "));