Blob Blame History Raw
diff --git a/builtins/declare.def b/builtins/declare.def
--- a/builtins/declare.def
+++ b/builtins/declare.def
@@ -420,11 +420,19 @@ declare_internal (list, local_var)
 
       if (local_var && variable_context && STREQ (name, "-"))
 	{
+	  int o;
+
+	  o = localvar_inherit;
+	  localvar_inherit = 0;
 	  var = make_local_variable ("-", 0);
-	  FREE (value_cell (var));		/* just in case */
-	  value = get_current_options ();
-	  var_setvalue (var, value);
-	  VSETATTR (var, att_invisible);
+	  localvar_inherit = o;
+
+	  if (value_cell (var) == NULL)		/* no duplicate instances */
+	    {
+	      value = get_current_options ();
+	      var_setvalue (var, value);
+	      VSETATTR (var, att_invisible);
+	    }
 	  NEXT_VARIABLE ();
 	}
 
diff --git a/patchlevel.h b/patchlevel.h
--- a/patchlevel.h
+++ b/patchlevel.h
@@ -25,6 +25,6 @@
    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
    looks for to find the patch level (for the sccs version string). */
 
-#define PATCHLEVEL 22
+#define PATCHLEVEL 23
 
 #endif /* _PATCHLEVEL_H_ */