summaryrefslogtreecommitdiff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/Modules/zpty.c3
-rw-r--r--Src/Zle/zle_misc.c2
-rw-r--r--Src/Zle/zle_move.c4
-rw-r--r--Src/Zle/zle_vi.c2
-rw-r--r--Src/builtin.c11
-rw-r--r--Src/parse.c2
6 files changed, 17 insertions, 7 deletions
diff --git a/Src/Modules/zpty.c b/Src/Modules/zpty.c
index 12e42b5bd..9741ee287 100644
--- a/Src/Modules/zpty.c
+++ b/Src/Modules/zpty.c
@@ -154,7 +154,8 @@ getptycmd(char *name)
return NULL;
}
-#ifdef USE_DEV_PTMX
+/* posix_openpt() seems to have some problem on OpenBSD */
+#if defined(USE_DEV_PTMX) && !defined(__OpenBSD__)
#ifdef HAVE_SYS_STROPTS_H
#include <sys/stropts.h>
diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c
index d25e4ebef..2d1862813 100644
--- a/Src/Zle/zle_misc.c
+++ b/Src/Zle/zle_misc.c
@@ -738,7 +738,7 @@ yankpop(UNUSED(char **args))
}
/**/
-char *
+mod_export char *
bracketedstring(void)
{
static const char endesc[] = "\033[201~";
diff --git a/Src/Zle/zle_move.c b/Src/Zle/zle_move.c
index f49df8647..155fda80d 100644
--- a/Src/Zle/zle_move.c
+++ b/Src/Zle/zle_move.c
@@ -344,6 +344,8 @@ endofline(char **args)
zlecs = zlell;
return 0;
}
+ if ((zlecs += invicmdmode()) == zlell)
+ break;
if (zleline[zlecs] == '\n')
if (++zlecs == zlell)
return 0;
@@ -414,6 +416,8 @@ endoflinehist(char **args)
zlecs = zlell;
break;
}
+ if ((zlecs += invicmdmode()) == zlell)
+ break;
if (zleline[zlecs] == '\n')
if (++zlecs == zlell)
break;
diff --git a/Src/Zle/zle_vi.c b/Src/Zle/zle_vi.c
index 1a11ca7d5..42dc46e7e 100644
--- a/Src/Zle/zle_vi.c
+++ b/Src/Zle/zle_vi.c
@@ -224,6 +224,7 @@ getvirange(int wf)
ZS_memcpy(zleline, lastline, zlell = lastll);
zlecs = pos;
mark = mpos;
+ virangeflag = 0;
return -1;
}
@@ -232,6 +233,7 @@ getvirange(int wf)
if (!zlell || (zlecs == pos && (mark == -1 || mark == zlecs) &&
virangeflag != 2) || ret == -1) {
mark = mpos;
+ virangeflag = 0;
return -1;
}
virangeflag = 0;
diff --git a/Src/builtin.c b/Src/builtin.c
index 3d34aa74c..97022addf 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -5465,8 +5465,8 @@ bin_emulate(UNUSED(char *nam), char **argv, Options ops, UNUSED(int func))
/* with single argument set current emulation */
if (!argv[1]) {
- emulate(shname, OPT_ISSET(ops,'R'), &emulation, opts);
- if (OPT_ISSET(ops,'L'))
+ emulate(shname, opt_R, &emulation, opts);
+ if (opt_L)
opts[LOCALOPTIONS] = opts[LOCALTRAPS] = opts[LOCALPATTERNS] = 1;
clearpatterndisables();
return 0;
@@ -5476,7 +5476,7 @@ bin_emulate(UNUSED(char *nam), char **argv, Options ops, UNUSED(int func))
memcpy(saveopts, opts, sizeof(opts));
memcpy(new_opts, opts, sizeof(opts));
savehackchar = keyboardhackchar;
- emulate(shname, OPT_ISSET(ops,'R'), &new_emulation, new_opts);
+ emulate(shname, opt_R, &new_emulation, new_opts);
optlist = newlinklist();
if (parseopts("emulate", &argv, new_opts, &cmd, optlist)) {
ret = 1;
@@ -5508,8 +5508,11 @@ bin_emulate(UNUSED(char *nam), char **argv, Options ops, UNUSED(int func))
goto restore2;
}
*--argv = cmd; /* on stack, never free()d, see execbuiltin() */
- } else
+ } else {
+ if (opt_L)
+ opts[LOCALOPTIONS] = opts[LOCALTRAPS] = opts[LOCALPATTERNS] = 1;
return 0;
+ }
save_sticky = sticky;
sticky = hcalloc(sizeof(*sticky));
diff --git a/Src/parse.c b/Src/parse.c
index 09317610b..7c2d20250 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -66,7 +66,7 @@ int infor;
/* != 0 if parsing arguments of typeset etc. */
/**/
-int intypeset;
+mod_export int intypeset;
/* list of here-documents */