Added custom psppire-selector widget.
[pspp-builds.git] / src / data / dictionary.c
index d38ed5fc1326d15f8d75e565c3bc77c9034f0fbe..0dadb959d371d5d0624f4dca21ff5d7c54d0a4ed 100644 (file)
@@ -352,9 +352,16 @@ dict_clone_var_assert (struct dictionary *d, const struct variable *old_var,
 struct variable *
 dict_lookup_var (const struct dictionary *d, const char *name)
 {
-  struct variable *target = var_create (name, 0);
-  struct variable *result = hsh_find (d->name_tab, target);
+  struct variable *target ;
+  struct variable *result ;
+
+  if ( ! var_is_valid_name (name, false))
+    return NULL;
+
+  target = var_create (name, 0);
+  result = hsh_find (d->name_tab, target);
   var_destroy (target);
+
   return result;
 }