Index: trunk/src/sh_extern.c
===================================================================
--- trunk/src/sh_extern.c	(revision 162)
+++ trunk/src/sh_extern.c	(revision 164)
@@ -1060,4 +1060,16 @@
 
   SL_RETURN (0, _("sh_ext_cleanup"));
+}
+
+/*
+ * -- explicitely close a command
+ */
+int sh_ext_close_command (const char * str)
+{
+  (void) str;
+  if (ext_coms == NULL || ext_failed == (-1))
+    return (-1);
+  ext_failed = (-1);
+  return 0;
 }
 
Index: trunk/src/sh_readconf.c
===================================================================
--- trunk/src/sh_readconf.c	(revision 162)
+++ trunk/src/sh_readconf.c	(revision 164)
@@ -742,4 +742,6 @@
   { N_("opencommand"),     SH_SECTION_EXTERNAL, SH_SECTION_NONE,  
     sh_ext_setcommand },
+  { N_("closecommand"),    SH_SECTION_EXTERNAL, SH_SECTION_NONE,  
+    sh_ext_close_command },
   { N_("setcommandline"),  SH_SECTION_EXTERNAL, SH_SECTION_NONE,  
     sh_ext_add_argv },
@@ -1108,6 +1110,7 @@
 
 static int sh_readconfig_line (char * line)
-{    
-  char * c;
+{
+  char * key;
+  char * value;
   char * tmp;
   int    i;
@@ -1117,4 +1120,11 @@
   int    modnum, modkey;
 #endif
+
+  static char  *dummy = N_("dummy");
+
+  static char  *closing[] = {
+    N_("closecommand"),
+    NULL
+  };
 
   static char  *ident[] = {
@@ -1157,10 +1167,50 @@
   SL_ENTER(_("sh_readconf_line"));
 
+  /* convert to lowercase                              */
+
+  tmp = line;
+  while (*tmp != '=' && *tmp != '\0')
+    {
+      *tmp = tolower( (int) *tmp);
+      ++tmp;
+    }
+
+  key = line;
+
   /* interpret line                                    */
 
-  c = strchr(line, '=');
-  if (c == NULL || (*c) == '\0')
-    {
-      if (line != NULL)
+  value = strchr(line, '=');
+
+  if (value == NULL || (*value) == '\0')
+    {
+      if (key != NULL)
+	{
+	  i = 0;
+	  while (closing[i] != NULL) 
+	    {
+	      if (sl_strncmp(key,_(closing[i]),sl_strlen(closing[i])-1) == 0)
+		{
+		  value = dummy;
+		  goto ok_novalue;
+		}
+	      ++i;
+	    }
+
+	  TPT(( 0, FIL__, __LINE__, _("msg=<ConfigFile: not key=value: %s>\n"),
+		line));
+	}
+      SL_RETURN(good_opt, _("sh_readconf_line"));
+    }
+  else
+    ++value;
+
+  /* skip leading whitespace
+   */
+  while ((*value) == ' ' || (*value) == '\t')
+    ++value;
+
+  if ((*value) == '\0')     /* no value                    */
+    {
+      if (key != NULL)
 	{
 	  TPT(( 0, FIL__, __LINE__, _("msg=<ConfigFile: not key=value: %s>\n"),
@@ -1169,30 +1219,6 @@
       SL_RETURN(good_opt, _("sh_readconf_line"));
     }
-  else
-    ++c;
-
-  /* skip leading whitespace
-   */
-  while ((*c) == ' ' || (*c) == '\t')
-    ++c;
-
-  if ((*c) == '\0')     /* no value                    */
-    {
-      if (line != NULL)
-	{
-	  TPT(( 0, FIL__, __LINE__, _("msg=<ConfigFile: not key=value: %s>\n"),
-		line));
-	}
-      SL_RETURN(good_opt, _("sh_readconf_line"));
-    }
-
-  /* convert to lowercase                              */
-
-  tmp = line;
-  while (*tmp != '=')
-    {
-      *tmp = tolower( (int) *tmp);
-      ++tmp;
-    }
+
+ ok_novalue:
 
   if (!sl_is_suid())
@@ -1210,12 +1236,12 @@
 	       ++modkey) 
 	    {
-	      if (sl_strncmp (line,   
+	      if (sl_strncmp (key,
 			      _(modList[modnum].conf_table[modkey].the_opt),
 			      sl_strlen(modList[modnum].conf_table[modkey].the_opt) ) == 0)
 		{
 		  good_opt = 0;
-		  if (0 != modList[modnum].conf_table[modkey].func(c))
+		  if (0 != modList[modnum].conf_table[modkey].func(value))
 		    sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_EINVALS,
-				     _(modList[modnum].conf_table[modkey].the_opt), c);
+				     _(modList[modnum].conf_table[modkey].the_opt), value);
 		  if (!sl_is_suid())
 		    {
@@ -1237,8 +1263,8 @@
       i = 0;
       while (ident[i] != NULL) {
-	if (sl_strncmp (line, _(ident[i]), sl_strlen(ident[i])-1) == 0)
+	if (sl_strncmp (key, _(ident[i]), sl_strlen(ident[i])-1) == 0)
 	  {
 	    good_opt = 0;
-	    sh_error_set_iv (identnum[i], c);
+	    sh_error_set_iv (identnum[i], value);
 	    break;
 	  }
@@ -1253,11 +1279,11 @@
 	  if ((ext_table[i].section == read_mode || 
 	       ext_table[i].alt_section == read_mode) &&
-	      sl_strncmp (line, _(ext_table[i].optname), 
+	      sl_strncmp (key, _(ext_table[i].optname), 
 			  sl_strlen(ext_table[i].optname)) == 0)
 	    {
 	      good_opt = 0;
-	      if (0 != ext_table[i].func (c))
+	      if (0 != ext_table[i].func (value))
 		sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_EINVALS,
-				 _(ext_table[i].optname), c);
+				 _(ext_table[i].optname), value);
 	      break;
 	    }
