summaryrefslogtreecommitdiffstats
path: root/contrib/tcsh/ed.chared.c
diff options
context:
space:
mode:
authormp <mp@FreeBSD.org>2012-02-22 03:36:15 +0000
committermp <mp@FreeBSD.org>2012-02-22 03:36:15 +0000
commit3ee51a00f36c11a6172d08d787943dfc63f66110 (patch)
tree522fd2d4d27770566e466a79d636194e5743d94a /contrib/tcsh/ed.chared.c
parentd177303078ee8f6069218009d6c3c2b6d9d9ca97 (diff)
parent54c5644df8eb87e7a5b1c4c411e349ac329ee04b (diff)
downloadFreeBSD-src-3ee51a00f36c11a6172d08d787943dfc63f66110.zip
FreeBSD-src-3ee51a00f36c11a6172d08d787943dfc63f66110.tar.gz
Update to tcsh 6.18.01.
Diffstat (limited to 'contrib/tcsh/ed.chared.c')
-rw-r--r--contrib/tcsh/ed.chared.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/contrib/tcsh/ed.chared.c b/contrib/tcsh/ed.chared.c
index 1ab5a91..8d00326 100644
--- a/contrib/tcsh/ed.chared.c
+++ b/contrib/tcsh/ed.chared.c
@@ -1,4 +1,4 @@
-/* $Header: /p/tcsh/cvsroot/tcsh/ed.chared.c,v 3.95 2009/06/25 21:15:37 christos Exp $ */
+/* $Header: /p/tcsh/cvsroot/tcsh/ed.chared.c,v 3.98 2010/05/08 00:37:39 christos Exp $ */
/*
* ed.chared.c: Character editing functions.
*/
@@ -72,7 +72,7 @@
#include "sh.h"
-RCSID("$tcsh: ed.chared.c,v 3.95 2009/06/25 21:15:37 christos Exp $")
+RCSID("$tcsh: ed.chared.c,v 3.98 2010/05/08 00:37:39 christos Exp $")
#include "ed.h"
#include "tw.h"
@@ -506,7 +506,7 @@ excl_sw:
if (*q == ':') /* short form: !:arg */
--q;
- if (*q != HIST) {
+ if (HIST != '\0' && *q != HIST) {
/*
* Search for a space, tab, or colon. See if we have a number (as
* in !1234:xyz). Remember the number.
@@ -716,8 +716,9 @@ c_excl(Char *p)
*/
nr_exp = 0;
for (;;) {
- while (*p != HIST && p < Cursor)
- ++p;
+ if (HIST != '\0')
+ while (*p != HIST && p < Cursor)
+ ++p;
for (i = 1; (p - i) >= InputBuf && p[-i] == '\\'; i++)
continue;
if (i % 2 == 0)
@@ -729,8 +730,6 @@ c_excl(Char *p)
++nr_exp;
}
}
-
- return nr_exp;
}
@@ -745,13 +744,13 @@ c_substitute(void)
* for white space, the beginning of the line, or a history character.
*/
for (p = Cursor - 1;
- p > InputBuf && *p != ' ' && *p != '\t' && *p != HIST; --p)
+ p > InputBuf && *p != ' ' && *p != '\t' && *p && *p != HIST; --p)
continue;
/*
* If we found a history character, go expand it.
*/
- if (*p == HIST)
+ if (HIST != '\0' && *p == HIST)
nr_exp = c_excl(p);
else
nr_exp = 0;
@@ -832,11 +831,11 @@ c_eword(Char *p, Char *high, int n)
while ((p < high) && Isspace(*p))
p++;
- if (Isalnum(*p))
- while ((p < high) && Isalnum(*p))
+ if (isword(*p))
+ while ((p < high) && isword(*p))
p++;
else
- while ((p < high) && !(Isspace(*p) || Isalnum(*p)))
+ while ((p < high) && !(Isspace(*p) || isword(*p)))
p++;
}
OpenPOWER on IntegriCloud