From beb0fef1eef30923cb563c2a0efd38ce9847f53f Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 9 Aug 2002 18:16:02 +0000 Subject: Tweaked the build system so that make distcheck finanly said Well Done. --- tests/asschk.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'tests/asschk.c') diff --git a/tests/asschk.c b/tests/asschk.c index 7b7321675..829c86273 100644 --- a/tests/asschk.c +++ b/tests/asschk.c @@ -30,8 +30,8 @@ a line is processed but after comment processing. Macros are only expanded once and non existing macros expand to the empty string. A macro is dereferenced by prefixing its name with a dollar sign; - the end of the name is currently indicated by a white space. To - use a dollor sign verbatim, double it. + the end of the name is currently indicated by a white space, a + dollar sign or a slash. To use a dollor sign verbatim, double it. A macro is assigned by prefixing a statement with the macro name and an equal sign. The value is assigned verbatim if it does not @@ -96,6 +96,9 @@ cmpfiles Returns true when the content of the files FIRST and SECOND match. + getenv + Return the value of the environment variable NAME. + */ #include @@ -571,7 +574,8 @@ expand_line (char *buffer) line = p + 1; continue; } - for (pend=p+1; *pend && !spacep (pend) && *pend != '$'; pend++) + for (pend=p+1; *pend && !spacep (pend) + && *pend != '$' && *pend != '/'; pend++) ; if (*pend) { @@ -854,6 +858,17 @@ cmd_cmpfiles (const char *assign_to, char *arg) fclose (fp2); } +static void +cmd_getenv (const char *assign_to, char *arg) +{ + const char *s; + s = *arg? getenv (arg):""; + set_var (assign_to, s? s:""); +} + + + + /* Process the current script line LINE. */ static int interpreter (char *line) @@ -875,6 +890,7 @@ interpreter (char *line) { "quit-if" , cmd_quit_if }, { "fail-if" , cmd_fail_if }, { "cmpfiles" , cmd_cmpfiles }, + { "getenv" , cmd_getenv }, { NULL } }; char *p, *save_p; -- cgit v1.2.3