summaryrefslogtreecommitdiff
path: root/lib/libkeynote/keynote.y
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-10-09 23:41:47 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>2000-10-09 23:41:47 +0000
commit132f98ce7c2e6402f374842f2e716cc4360e5c3d (patch)
tree76d040df72e03621433212e33702eb7bcee0df19 /lib/libkeynote/keynote.y
parent3842a1e9b95d710ee955343ebeccb900e11841b6 (diff)
Sync.
Diffstat (limited to 'lib/libkeynote/keynote.y')
-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;
}
/*