summaryrefslogtreecommitdiff
path: root/libguile/modules.c
diff options
context:
space:
mode:
authorNeil Jerram <neil@ossau.uklinux.net>2010-04-10 13:32:42 +0100
committerNeil Jerram <neil@ossau.uklinux.net>2010-04-10 13:32:42 +0100
commit26b9f9090073c896762af3125af54958e153f8f2 (patch)
tree11c799f1191ef122c66329c36d6b03230c6962ef /libguile/modules.c
parent3ce5e1304bd77eb167f856a2a163038f01f452c8 (diff)
parent96ec2c9c65468b1404865371d19342d6badb0be9 (diff)
downloadguile-26b9f9090073c896762af3125af54958e153f8f2.tar.gz
Merge branch 'master' into wip-manual-2
Conflicts: doc/ref/api-procedures.texi doc/ref/misc-modules.texi (Caused by me removing `@page' from a couple of sections that have been modified by others.)
Diffstat (limited to 'libguile/modules.c')
-rw-r--r--libguile/modules.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/libguile/modules.c b/libguile/modules.c
index 545281a18..fc6ff3b47 100644
--- a/libguile/modules.c
+++ b/libguile/modules.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998,2000,2001,2002,2003,2004,2006,2007,2008,2009 Free Software Foundation, Inc.
+/* Copyright (C) 1998,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -801,6 +801,8 @@ SCM_DEFINE (scm_module_reverse_lookup, "module-reverse-lookup", 2, 0, 0,
obarray = SCM_MODULE_OBARRAY (module);
}
+ SCM_VALIDATE_VARIABLE (SCM_ARG2, variable);
+
if (!SCM_HASHTABLE_P (obarray))
return SCM_BOOL_F;
@@ -830,17 +832,18 @@ SCM_DEFINE (scm_module_reverse_lookup, "module-reverse-lookup", 2, 0, 0,
}
}
- /* Try the `uses' list. */
- {
- SCM uses = SCM_MODULE_USES (module);
- while (scm_is_pair (uses))
- {
- SCM sym = scm_module_reverse_lookup (SCM_CAR (uses), variable);
- if (scm_is_true (sym))
- return sym;
- uses = SCM_CDR (uses);
- }
- }
+ if (!scm_is_false (module))
+ {
+ /* Try the `uses' list. */
+ SCM uses = SCM_MODULE_USES (module);
+ while (scm_is_pair (uses))
+ {
+ SCM sym = scm_module_reverse_lookup (SCM_CAR (uses), variable);
+ if (scm_is_true (sym))
+ return sym;
+ uses = SCM_CDR (uses);
+ }
+ }
return SCM_BOOL_F;
}