diff options
author | Brian Somers <brian@FreeBSD.org> | 1999-06-10 09:34:57 +0000 |
---|---|---|
committer | Brian Somers <brian@FreeBSD.org> | 1999-06-10 09:34:57 +0000 |
commit | 5dfb9210ae71baa625df2b26661e32ade138ed2e (patch) | |
tree | 32bd72418202efb35e70ba9acfd44ea4a694d8f0 | |
parent | 194c225d5ce936f78a8ebdec4ca67c05b524a128 (diff) | |
download | src-5dfb9210ae71baa625df2b26661e32ade138ed2e.tar.gz src-5dfb9210ae71baa625df2b26661e32ade138ed2e.zip |
Allow reserved substitution strings to be escaped by preceeding them
with a backslash.
Notes
Notes:
svn path=/head/; revision=47865
-rw-r--r-- | usr.sbin/ppp/command.c | 12 |
1 files 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 <sys/param.h> @@ -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; } |