diff options
author | brian <brian@cvs.openbsd.org> | 1999-06-10 09:34:43 +0000 |
---|---|---|
committer | brian <brian@cvs.openbsd.org> | 1999-06-10 09:34:43 +0000 |
commit | 4edb94ce83efebfaadfbb27019d9376633dc3fc2 (patch) | |
tree | 9816f7dabede70fa2eba3015b99dfdedb3429d74 /usr.sbin | |
parent | 9d140a06288ebc456ba3f34b20caacfe08fb7d99 (diff) |
Allow reserved substitution strings to be escaped by preceeding them
with a backslash.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/ppp/command.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/ppp/ppp/command.c b/usr.sbin/ppp/ppp/command.c index 6357d44f419..01dca786260 100644 --- a/usr.sbin/ppp/ppp/command.c +++ b/usr.sbin/ppp/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.28 1999/06/09 16:55:25 brian Exp $ + * $Id: command.c,v 1.29 1999/06/10 09:34:42 brian Exp $ * */ #include <sys/param.h> @@ -144,7 +144,7 @@ #define NEG_VJCOMP 53 const char Version[] = "2.22"; -const char VersionDate[] = "$Date: 1999/06/09 16:55:25 $"; +const char VersionDate[] = "$Date: 1999/06/10 09:34:42 $"; 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; } |