summaryrefslogtreecommitdiff
path: root/sh.lex.c
diff options
context:
space:
mode:
Diffstat (limited to 'sh.lex.c')
-rw-r--r--sh.lex.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/sh.lex.c b/sh.lex.c
index 80643f7b17313..cf8fbca4bdb98 100644
--- a/sh.lex.c
+++ b/sh.lex.c
@@ -1,4 +1,4 @@
-/* $Header: /p/tcsh/cvsroot/tcsh/sh.lex.c,v 3.87 2011/01/24 17:48:15 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/sh.lex.c,v 3.91 2016/08/01 16:21:09 christos Exp $ */
/*
* sh.lex.c: Lexical analysis into tokens
*/
@@ -32,7 +32,7 @@
*/
#include "sh.h"
-RCSID("$tcsh: sh.lex.c,v 3.87 2011/01/24 17:48:15 christos Exp $")
+RCSID("$tcsh: sh.lex.c,v 3.91 2016/08/01 16:21:09 christos Exp $")
#include "ed.h"
@@ -66,7 +66,6 @@ static int getsel (int *, int *, int);
static struct wordent *getsub (struct wordent *);
static Char *subword (Char *, Char, int *, size_t *);
static struct wordent *dosub (Char, struct wordent *, int);
-static ssize_t wide_read (int, Char *, size_t, int);
/*
* Peekc is a peek character for getC, peekread for readc.
@@ -258,6 +257,14 @@ copylex(struct wordent *hp, struct wordent *fp)
}
void
+initlex(struct wordent *vp)
+{
+ vp->word = STRNULL;
+ vp->prev = vp;
+ vp->next = vp;
+}
+
+void
freelex(struct wordent *vp)
{
struct wordent *fp;
@@ -378,7 +385,7 @@ loop:
*/
c |= QUOTE;
ungetC(c);
- c = '\\';
+ c = '\\' | QUOTE;
}
}
}
@@ -1539,7 +1546,7 @@ balloc(int buf)
}
}
-static ssize_t
+ssize_t
wide_read(int fildes, Char *buf, size_t nchars, int use_fclens)
{
char cbuf[BUFSIZE + 1];