diff options
author | msmith <msmith@FreeBSD.org> | 1999-01-10 05:08:12 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1999-01-10 05:08:12 +0000 |
commit | e50aa55751caccf7ccaf43d7a09795ff12967ade (patch) | |
tree | e11ac865a34abab8e4e6ebe08186e961136cc3b3 /sys/boot/common/interp_parse.c | |
parent | 25a87c9b4297bdb1834d99f5e00eac4185a09477 (diff) | |
download | FreeBSD-src-e50aa55751caccf7ccaf43d7a09795ff12967ade.zip FreeBSD-src-e50aa55751caccf7ccaf43d7a09795ff12967ade.tar.gz |
Enable escapes for $ to make it possible to insert variable names into
other variable values.
Diffstat (limited to 'sys/boot/common/interp_parse.c')
-rw-r--r-- | sys/boot/common/interp_parse.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/boot/common/interp_parse.c b/sys/boot/common/interp_parse.c index ef23563..a450f7d 100644 --- a/sys/boot/common/interp_parse.c +++ b/sys/boot/common/interp_parse.c @@ -11,7 +11,7 @@ * Jordan K. Hubbard * 29 August 1998 * - * $Id: interp_parse.c,v 1.3 1998/09/04 02:43:26 msmith Exp $ + * $Id: interp_parse.c,v 1.4 1998/09/17 23:52:02 msmith Exp $ * * The meat of the simple parser. */ @@ -100,7 +100,11 @@ parse(int *argc, char ***argv, char *str) while (*p) { switch (state) { case STR: - if (isquote(*p)) { + if ((*p == '\\') && p[1]) { + p++; + PARSE_FAIL(i == (PARSE_BUFSIZE - 1)); + buf[i] = *p++; + } else if (isquote(*p)) { quote = quote ? 0 : *p; ++p; } |