From 5dfb9210ae71baa625df2b26661e32ade138ed2e Mon Sep 17 00:00:00 2001 From: Brian Somers Date: Thu, 10 Jun 1999 09:34:57 +0000 Subject: [PATCH] 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(-) diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c index 151d4e08f48c..dad0acbb0d7c 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; }