From 0a48bba6aa2f009105a2aff213b9b977aa2dff2e Mon Sep 17 00:00:00 2001 From: brian Date: Thu, 10 Jun 1999 09:34:57 +0000 Subject: Allow reserved substitution strings to be escaped by preceeding them with a backslash. --- usr.sbin/ppp/command.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'usr.sbin/ppp') diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c index 151d4e0..dad0acb 100644 --- a/usr.sbin/ppp/command.c +++ b/usr.sbin/ppp/command.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: command.c,v 1.200 1999/06/09 08:47:32 brian Exp $ + * $Id: command.c,v 1.201 1999/06/09 16:54:02 brian Exp $ * */ #include @@ -144,7 +144,7 @@ #define NEG_VJCOMP 53 const char Version[] = "2.22"; -const char VersionDate[] = "$Date: 1999/06/09 08:47:32 $"; +const char VersionDate[] = "$Date: 1999/06/09 16:54:02 $"; static int ShowCommand(struct cmdargs const *); static int TerminalCommand(struct cmdargs const *); @@ -354,10 +354,12 @@ strstrword(char *big, const char *little) len = strlen(little); while ((pos = strstr(pos, little)) != NULL) - if ((pos == big || !isinword(pos[-1])) && !isinword(pos[len])) - break; - else + if ((pos != big && isinword(pos[-1])) || isinword(pos[len])) pos++; + else if (pos != big && pos[-1] == '\\') + memmove(pos - 1, pos, strlen(pos) + 1); + else + break; return pos; } -- cgit v1.1