summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorangelos <angelos@openbsd.org>2000-10-09 23:41:46 +0000
committerangelos <angelos@openbsd.org>2000-10-09 23:41:46 +0000
commiteb225e733de4be21ddadec93a03d2614e3129b02 (patch)
tree1d452dff20aebb816a2cd9b76663150bf9bb4551
parentsamples/VPN-3way-template.conf: Merge with EOM 1.8 (diff)
downloadwireguard-openbsd-eb225e733de4be21ddadec93a03d2614e3129b02.tar.xz
wireguard-openbsd-eb225e733de4be21ddadec93a03d2614e3129b02.zip
Sync.
-rw-r--r--lib/libkeynote/keynote.y66
1 files changed, 44 insertions, 22 deletions
diff --git a/lib/libkeynote/keynote.y b/lib/libkeynote/keynote.y
index 2dc6225475d..f49ebb15ed1 100644
--- a/lib/libkeynote/keynote.y
+++ b/lib/libkeynote/keynote.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: keynote.y,v 1.7 2000/06/13 19:03:11 angelos Exp $ */
+/* $OpenBSD: keynote.y,v 1.8 2000/10/09 23:41:46 angelos Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@dsl.cis.upenn.edu)
*
@@ -742,33 +742,55 @@ my_lookup(char *s)
}
/* Temporary list (regexp results) */
- ret = keynote_env_lookup(s, &keynote_temp_list, 1);
- if (ret != (char *) NULL)
- return ret;
- else
- if (keynote_errno != 0)
- return (char *) NULL;
+ if (keynote_temp_list != NULL)
+ {
+ ret = keynote_env_lookup(s, &keynote_temp_list, 1);
+ if (ret != (char *) NULL)
+ return ret;
+ else
+ if (keynote_errno != 0)
+ return (char *) NULL;
+ }
/* Local-Constants */
- ret = keynote_env_lookup(s, &keynote_init_list, 1);
- if (ret != (char *) NULL)
- return ret;
- else
- if (keynote_errno != 0)
- return (char *) NULL;
+ if (keynote_init_list != NULL)
+ {
+ ret = keynote_env_lookup(s, &keynote_init_list, 1);
+ if (ret != (char *) NULL)
+ return ret;
+ else
+ if (keynote_errno != 0)
+ return (char *) NULL;
+ }
- keynote_used_variable = 1;
+ if ((ks != NULL) && (ks->ks_env_table != NULL))
+ {
+ /* Action environment */
+ ret = keynote_env_lookup(s, ks->ks_env_table, HASHTABLESIZE);
+ if (ret != (char *) NULL)
+ {
+ keynote_used_variable = 1;
+ return ret;
+ }
+ else
+ if (keynote_errno != 0)
+ return (char *) NULL;
+ }
+
+ /* Regex table */
+ if ((ks != NULL) && (ks->ks_env_regex != NULL))
+ {
+ ret = keynote_env_lookup(s, &(ks->ks_env_regex), 1);
+ if (ret != (char *) NULL)
+ {
+ keynote_used_variable = 1;
+ return ret;
+ }
- /* Action environment */
- ret = keynote_env_lookup(s, ks->ks_env_table, HASHTABLESIZE);
- if (ret != (char *) NULL)
- return ret;
- else
- if (keynote_errno != 0)
return (char *) NULL;
+ }
- /* Regex table */
- return keynote_env_lookup(s, &(ks->ks_env_regex), 1);
+ return (char *) NULL;
}
/*