aboutsummaryrefslogtreecommitdiff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2015-03-22 19:21:10 +0000
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2015-03-22 19:21:10 +0000
commitf6be7bc19f4db61ddf7ce01e34f878c27eb5cb40 (patch)
treebadff6fda6d8c919d5a22314d063f035307918c5 /Src
parent4fb669a72deb547b6ec1c9298373e3b78384983d (diff)
downloadzsh-f6be7bc19f4db61ddf7ce01e34f878c27eb5cb40.tar.gz
zsh-f6be7bc19f4db61ddf7ce01e34f878c27eb5cb40.tar.xz
zsh-f6be7bc19f4db61ddf7ce01e34f878c27eb5cb40.zip
34759: improve implementation of last commit
Diffstat (limited to 'Src')
-rw-r--r--Src/hist.c3
-rw-r--r--Src/lex.c12
2 files changed, 8 insertions, 7 deletions
diff --git a/Src/hist.c b/Src/hist.c
index 70dfac036..b44f4ad18 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -527,7 +527,8 @@ histsubchar(int c)
static int marg = -1;
static zlong mev = -1;
char *buf, *ptr;
- char *sline, *lexraw_mark;
+ char *sline;
+ int lexraw_mark;
Histent ehist;
size_t buflen;
diff --git a/Src/lex.c b/Src/lex.c
index 6b9e94289..6d0079c8f 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -1872,22 +1872,22 @@ zshlex_raw_back(void)
}
/**/
-char *
+int
zshlex_raw_mark(int offset)
{
if (!lex_add_raw)
- return NULL;
- return lexbuf_raw.ptr + offset;
+ return 0;
+ return lexbuf_raw.len + offset;
}
/**/
void
-zshlex_raw_back_to_mark(char *mark)
+zshlex_raw_back_to_mark(int mark)
{
if (!lex_add_raw)
return;
- lexbuf_raw.len -= lexbuf_raw.ptr - mark;
- lexbuf_raw.ptr = mark;
+ lexbuf_raw.ptr = tokstr_raw + mark;
+ lexbuf_raw.len = mark;
}
/*