summaryrefslogtreecommitdiff
path: root/tw.parse.c
diff options
context:
space:
mode:
authorDmitry Chagin <dchagin@FreeBSD.org>2017-03-18 21:41:53 +0000
committerDmitry Chagin <dchagin@FreeBSD.org>2017-03-18 21:41:53 +0000
commit6895abeab878a30d05c122c2467990ebb47bd58a (patch)
treec83c107f25929f537445d21738c490d53c59b94d /tw.parse.c
parent0bc8d6575fcb65f394796e060efa34444d983b7b (diff)
Notes
Diffstat (limited to 'tw.parse.c')
-rw-r--r--tw.parse.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/tw.parse.c b/tw.parse.c
index dc32dbaaaf6a..51c6cb34a113 100644
--- a/tw.parse.c
+++ b/tw.parse.c
@@ -1,4 +1,4 @@
-/* $Header: /p/tcsh/cvsroot/tcsh/tw.parse.c,v 3.133 2011/04/14 14:33:05 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/tw.parse.c,v 3.139 2015/10/16 14:59:56 christos Exp $ */
/*
* tw.parse.c: Everyone has taken a shot in this futile effort to
* lexically analyze a csh line... Well we cannot good
@@ -35,7 +35,7 @@
*/
#include "sh.h"
-RCSID("$tcsh: tw.parse.c,v 3.133 2011/04/14 14:33:05 christos Exp $")
+RCSID("$tcsh: tw.parse.c,v 3.139 2015/10/16 14:59:56 christos Exp $")
#include "tw.h"
#include "ed.h"
@@ -618,7 +618,11 @@ insert_meta(const Char *cp, const Char *cpend, const Char *word,
break;
wq = w & QUOTE;
- w &= ~QUOTE;
+#if INVALID_BYTE != 0
+ /* add checking INVALID_BYTE for FIX UTF32 */
+ if ((w & INVALID_BYTE) != INVALID_BYTE) /* w < INVALID_BYTE */
+#endif
+ w &= ~QUOTE;
if (cmap(w, _ESC | _QF))
wq = QUOTE; /* quotes are always quoted */
@@ -1236,7 +1240,7 @@ static Char
tw_suffix(int looking, struct Strbuf *word, const Char *exp_dir, Char *exp_name)
{
Char *ptr;
- Char *dollar;
+ Char *dol;
struct varent *vp;
(void) strip(exp_name);
@@ -1258,8 +1262,8 @@ tw_suffix(int looking, struct Strbuf *word, const Char *exp_dir, Char *exp_name)
else if ((ptr = tgetenv(exp_name)) == NULL || *ptr == '\0')
return ' ';
- if ((dollar = Strrchr(word->s, '$')) != 0 &&
- dollar[1] == '{' && Strchr(dollar, '}') == NULL)
+ if ((dol = Strrchr(word->s, '$')) != 0 &&
+ dol[1] == '{' && Strchr(dol, '}') == NULL)
return '}';
return isadirectory(exp_dir, ptr) ? '/' : ' ';