diff --git a/ed.chared.c b/ed.chared.c index c978b69f..8a78e86b 100644 --- a/ed.chared.c +++ b/ed.chared.c @@ -257,7 +257,7 @@ c_preword(Char *p, Char *low, int n, Char *delim) Char *new; while (prev < p) { /* Skip initial non-word chars */ - if (!Strchr(delim, *prev) || *(prev-1) == (Char)'\\') + if (!Strchr(delim, *prev) || (prev != low && *(prev-1) == (Char)'\\')) break; prev++; } @@ -269,7 +269,7 @@ c_preword(Char *p, Char *low, int n, Char *delim) new = c_endword(prev-1, p, 1, delim); /* Skip to next non-word char */ new++; /* Step away from end of word */ while (new <= p) { /* Skip trailing non-word chars */ - if (!Strchr(delim, *new) || *(new-1) == (Char)'\\') + if (!Strchr(delim, *new) || new != prev && *(new-1) == (Char)'\\') break; new++; }