From MAILER-DAEMON Mon Feb 20 15:39:26 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Rza18-00015w-ID
	for mharc-commit-mailutils@gnu.org; Mon, 20 Feb 2012 15:39:26 -0500
Received: from eggs.gnu.org ([140.186.70.92]:47599)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Rza11-00014Y-6d
	for commit-mailutils@gnu.org; Mon, 20 Feb 2012 15:39:24 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Rza0z-0006Tu-OA
	for commit-mailutils@gnu.org; Mon, 20 Feb 2012 15:39:19 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:53420)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Rza0z-0006Tq-Lj
	for commit-mailutils@gnu.org; Mon, 20 Feb 2012 15:39:17 -0500
Received: from gray by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Rza0x-0004qn-ML
	for commit-mailutils@gnu.org; Mon, 20 Feb 2012 20:39:17 +0000
Date: Mon, 20 Feb 2012 20:39:16 +0000
Message-Id: <E1Rza0x-0004qn-ML@vcs.savannah.gnu.org>
From: "Sergey Poznyakoff" <gray@gnu.org.ua>
To: commit-mailutils@gnu.org
Subject: [SCM] GNU Mailutils branch, master, updated. release-2.2-568-g18c565b
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: a940c38c3cc0fdbb052101dd65edd22daf811c49
X-Git-Newrev: 18c565be94550abfcb86787ce0dda698dd54a223
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.72
X-BeenThere: commit-mailutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit notices for GNU mailutils <commit-mailutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-mailutils>,
	<mailto:commit-mailutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-mailutils>
List-Post: <mailto:commit-mailutils@gnu.org>
List-Help: <mailto:commit-mailutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-mailutils>,
	<mailto:commit-mailutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 20 Feb 2012 20:39:24 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=18c565be94550abfcb86787ce0dda698dd54a223

The branch, master has been updated
       via  18c565be94550abfcb86787ce0dda698dd54a223 (commit)
      from  a940c38c3cc0fdbb052101dd65edd22daf811c49 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 18c565be94550abfcb86787ce0dda698dd54a223
Author: Sergey Poznyakoff <gray@gnu.org.ua>
Date:   Mon Feb 20 22:38:16 2012 +0200

    Bugfix.
    
    * mh/mhn.c (mhn_edit): Destroy output prior to
    unreferencing msg, because it may have been taken
    from it.

-----------------------------------------------------------------------

Summary of changes:
 mh/mhn.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/mh/mhn.c b/mh/mhn.c
index 221e62c..5aadf94 100644
--- a/mh/mhn.c
+++ b/mh/mhn.c
@@ -2711,15 +2711,14 @@ mhn_edit (struct compose_env *env, int level)
     }
   free (buf);
 
+  mu_stream_destroy (&output);
   if (msg)
     {
-      mu_stream_close (output);
       if (line_count)
 	finish_text_msg (env, &msg, ascii_buf);
       else
 	mu_message_unref (msg);
     }
-  mu_stream_destroy (&output);
   
   return status;
 }


hooks/post-receive
-- 
GNU Mailutils


From MAILER-DAEMON Tue Feb 21 06:41:54 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Rzo6U-0006LA-FN
	for mharc-commit-mailutils@gnu.org; Tue, 21 Feb 2012 06:41:54 -0500
Received: from eggs.gnu.org ([140.186.70.92]:34631)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Rzo6K-0006G4-GD
	for commit-mailutils@gnu.org; Tue, 21 Feb 2012 06:41:53 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Rzo6A-0000HA-6H
	for commit-mailutils@gnu.org; Tue, 21 Feb 2012 06:41:44 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:37627)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Rzo6A-0000H6-1L
	for commit-mailutils@gnu.org; Tue, 21 Feb 2012 06:41:34 -0500
Received: from gray by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Rzo63-0008EW-AU
	for commit-mailutils@gnu.org; Tue, 21 Feb 2012 11:41:33 +0000
Date: Tue, 21 Feb 2012 11:41:32 +0000
Message-Id: <E1Rzo63-0008EW-AU@vcs.savannah.gnu.org>
From: "Sergey Poznyakoff" <gray@gnu.org.ua>
To: commit-mailutils@gnu.org
Subject: [SCM] GNU Mailutils branch, master, updated. release-2.2-569-g8c0c0bf
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 18c565be94550abfcb86787ce0dda698dd54a223
X-Git-Newrev: 8c0c0bfc2d565c70d0af0dcd7f1baa271a638661
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.72
X-BeenThere: commit-mailutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit notices for GNU mailutils <commit-mailutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-mailutils>,
	<mailto:commit-mailutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-mailutils>
List-Post: <mailto:commit-mailutils@gnu.org>
List-Help: <mailto:commit-mailutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-mailutils>,
	<mailto:commit-mailutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 21 Feb 2012 11:41:53 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=8c0c0bfc2d565c70d0af0dcd7f1baa271a638661

The branch, master has been updated
       via  8c0c0bfc2d565c70d0af0dcd7f1baa271a638661 (commit)
      from  18c565be94550abfcb86787ce0dda698dd54a223 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8c0c0bfc2d565c70d0af0dcd7f1baa271a638661
Author: Sergey Poznyakoff <gray@gnu.org.ua>
Date:   Tue Feb 21 13:40:21 2012 +0200

    Bugfixes.
    
    * include/mailutils/Makefile.am: Add types to pkginclude_HEADERS.
    * libmailutils/tests/url-comp.at: Add missing dnl.

-----------------------------------------------------------------------

Summary of changes:
 include/mailutils/Makefile.am  |    4 ++--
 libmailutils/tests/url-comp.at |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/mailutils/Makefile.am b/include/mailutils/Makefile.am
index 1f75663..ace8fcd 100644
--- a/include/mailutils/Makefile.am
+++ b/include/mailutils/Makefile.am
@@ -14,7 +14,7 @@
 ## You should have received a copy of the GNU General Public License
 ## along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
 
-BUILT_SOURCES=errno.h
+BUILT_SOURCES=errno.h types.h
 EXTRA_DIST=errno.hin types.hin
 errno.h: $(top_srcdir)/libmailutils/diag/errors errno.hin
 	$(AM_V_GEN)$(AWK) -f $(mu_aux_dir)/generr.awk $^ > $@
@@ -23,7 +23,6 @@ types.h: $(top_srcdir)/include/mailutils/types.hin Makefile
 	$(AM_V_GEN)sed 's/_MU_OFF_TYPE_/$(MU_OFF_TYPE)/;s/_MU_DEFAULT_RECORD_/$(MU_DEFAULT_RECORD)/' $(top_srcdir)/include/mailutils/types.hin > $@
 DISTCLEANFILES = types.h
 
-pkginclude_DATA = types.h
 pkginclude_HEADERS = \
  acl.h\
  address.h\
@@ -100,6 +99,7 @@ pkginclude_HEADERS = \
  syslog.h\
  sql.h\
  tls.h\
+ types.h\
  url.h\
  vartab.h\
  version.h\
diff --git a/libmailutils/tests/url-comp.at b/libmailutils/tests/url-comp.at
index 6f80885..3ec5c94 100644
--- a/libmailutils/tests/url-comp.at
+++ b/libmailutils/tests/url-comp.at
@@ -17,7 +17,7 @@
 AT_BANNER(URL Composition)
 
 dnl ------------------------------------------------------------
-             1   2        3                4
+dnl          1   2        3                4
 dnl URLCOMP(KW, ARGS, [STDOUT = `'], [STDERR = `'])
 dnl
 


hooks/post-receive
-- 
GNU Mailutils


From MAILER-DAEMON Sun Feb 26 17:26:57 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1S1mYT-00013v-Re
	for mharc-commit-mailutils@gnu.org; Sun, 26 Feb 2012 17:26:57 -0500
Received: from eggs.gnu.org ([208.118.235.92]:57156)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1S1mYQ-00013U-HO
	for commit-mailutils@gnu.org; Sun, 26 Feb 2012 17:26:56 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1S1mYO-00048F-0l
	for commit-mailutils@gnu.org; Sun, 26 Feb 2012 17:26:54 -0500
Received: from vcs.savannah.gnu.org ([140.186.70.72]:47150)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1S1mYN-000486-SR
	for commit-mailutils@gnu.org; Sun, 26 Feb 2012 17:26:51 -0500
Received: from gray by vcs.savannah.gnu.org with local (Exim 4.72)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1S1mYM-0006jZ-UQ
	for commit-mailutils@gnu.org; Sun, 26 Feb 2012 22:26:51 +0000
Date: Sun, 26 Feb 2012 22:26:51 +0000
Message-Id: <E1S1mYM-0006jZ-UQ@vcs.savannah.gnu.org>
From: "Sergey Poznyakoff" <gray@gnu.org.ua>
To: commit-mailutils@gnu.org
Subject: [SCM] GNU Mailutils branch, master, updated. release-2.2-571-ge70212c
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 8c0c0bfc2d565c70d0af0dcd7f1baa271a638661
X-Git-Newrev: e70212c14a55b8e5e55eb3ad44513fd402553026
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.72
X-BeenThere: commit-mailutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Commit notices for GNU mailutils <commit-mailutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/commit-mailutils>,
	<mailto:commit-mailutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/commit-mailutils>
List-Post: <mailto:commit-mailutils@gnu.org>
List-Help: <mailto:commit-mailutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/commit-mailutils>,
	<mailto:commit-mailutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 26 Feb 2012 22:26:56 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=e70212c14a55b8e5e55eb3ad44513fd402553026

The branch, master has been updated
       via  e70212c14a55b8e5e55eb3ad44513fd402553026 (commit)
       via  fb53814d3acb7a08cd849ffbbdbe86d8a374590c (commit)
      from  8c0c0bfc2d565c70d0af0dcd7f1baa271a638661 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e70212c14a55b8e5e55eb3ad44513fd402553026
Author: Sergey Poznyakoff <gray@gnu.org.ua>
Date:   Sun Feb 26 21:19:07 2012 +0200

    Fix locking of Berkeley databases.
    
    * include/mailutils/locker.h (mu_locker_lock_mode): New proto.
    * libmailutils/base/locker.c (_mu_locker_lock): Rename to
    mu_locker_lock_mode.  All callers updated.
    * libmu_dbm/berkeley.c (bdb_file) <locker>: New member.
    (do_bdb_open): New function.  Lock the database file before opening it.
    Drop support for version 2.
    (_bdb_open): Rewrite as a wrapper over do_bdb_open.
    * mu/dbm.c (dbm_doc): Document the "dump" subcommand.
    
    * NEWS: Version 2.99.96
    * configure.ac: Likewise.

commit fb53814d3acb7a08cd849ffbbdbe86d8a374590c
Author: Sergey Poznyakoff <gray@gnu.org.ua>
Date:   Sun Feb 26 18:27:30 2012 +0200

    Fix parsing local URLs.
    
    * include/mailutils/url.h (MU_URL_PARSE_LOCAL): New flag.
    * libmailutils/tests/url-parse.c (parse_kwtab): New flag
    "local".
    * libmailutils/tests/url.at: Add new tests
    * libmailutils/url/create.c (_mu_url_ctx_parse_host): Skip
    parsing host part if MU_URL_PARSE_LOCAL is set.
    (_mu_url_create_internal): Initialize rc. If MU_URL_PARSE_SLASH
    is set and URL begins with "./" assume it is file.
    If either MU_URL_PARSE_SLASH or MU_URL_PARSE_PIPE are given
    and the URL is diagnosed as file or pipe, prever the scheme
    from hints.

-----------------------------------------------------------------------

Summary of changes:
 NEWS                           |    4 +-
 configure.ac                   |    2 +-
 include/mailutils/locker.h     |    1 +
 include/mailutils/url.h        |    1 +
 libmailutils/base/locker.c     |    4 +-
 libmailutils/tests/url-parse.c |    1 +
 libmailutils/tests/url.at      |   53 +++++++++++++++++++++++
 libmailutils/url/create.c      |   34 +++++++++-----
 libmu_dbm/berkeley.c           |   93 ++++++++++++++++++++++++++++------------
 mu/dbm.c                       |    1 +
 10 files changed, 150 insertions(+), 44 deletions(-)

diff --git a/NEWS b/NEWS
index 97692d8..90f0446 100644
--- a/NEWS
+++ b/NEWS
@@ -1,11 +1,11 @@
-GNU mailutils NEWS -- history of user-visible changes. 2011-12-31
+GNU mailutils NEWS -- history of user-visible changes. 2012-02-26
 Copyright (C) 2002-2012 Free Software Foundation, Inc.
 See the end of file for copying conditions.
 
 Please send mailutils bug reports to <bug-mailutils@gnu.org>.
 
 
-Version 2.99.95 (Git)
+Version 2.99.96 (Git)
 
 This version is a major rewrite of GNU Mailutils.  Quite a few parts
 of the basic framework were rewritten from scratch, while some others
diff --git a/configure.ac b/configure.ac
index 7948ce3..fae7bc2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU General Public License along
 dnl with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
 
 AC_PREREQ(2.63)
-AC_INIT([GNU Mailutils], [2.99.95], [bug-mailutils@gnu.org], [mailutils])
+AC_INIT([GNU Mailutils], [2.99.96], [bug-mailutils@gnu.org], [mailutils])
 AC_CONFIG_SRCDIR([libmailutils/mailbox/mailbox.c])
 AC_CONFIG_AUX_DIR([build-aux])
 AM_INIT_AUTOMAKE([gnits 1.11 dist-bzip2 dist-xz std-options silent-rules])
diff --git a/include/mailutils/locker.h b/include/mailutils/locker.h
index 883123d..df16ca4 100644
--- a/include/mailutils/locker.h
+++ b/include/mailutils/locker.h
@@ -133,6 +133,7 @@ enum mu_locker_mode
                     locking otherwise */
 }; 
 
+extern int mu_locker_lock_mode (mu_locker_t, enum mu_locker_mode);
 extern int mu_locker_lock          (mu_locker_t);
 extern int mu_locker_touchlock     (mu_locker_t);
 extern int mu_locker_unlock        (mu_locker_t);
diff --git a/include/mailutils/url.h b/include/mailutils/url.h
index 8ab695d..4ebb064 100644
--- a/include/mailutils/url.h
+++ b/include/mailutils/url.h
@@ -61,6 +61,7 @@ extern "C" {
 					     "file:///..." */
 #define MU_URL_PARSE_DSLASH_OPTIONAL 0x0040 /* Double-slash after scheme:
 					       part is optional */
+#define MU_URL_PARSE_LOCAL        0x0080  /* Local URL: no host part */   
   
 #define MU_URL_PARSE_DEFAULT \
   (MU_URL_PARSE_HEXCODE|MU_URL_PARSE_HIDEPASS|MU_URL_PARSE_PORTSRV|\
diff --git a/libmailutils/base/locker.c b/libmailutils/base/locker.c
index 78bb86e..940e382 100644
--- a/libmailutils/base/locker.c
+++ b/libmailutils/base/locker.c
@@ -547,7 +547,7 @@ mu_locker_destroy (mu_locker_t *plocker)
 }
 
 int
-_mu_locker_lock (mu_locker_t lock, enum mu_locker_mode mode)
+mu_locker_lock_mode (mu_locker_t lock, enum mu_locker_mode mode)
 {
   int rc;
   unsigned type;
@@ -598,7 +598,7 @@ _mu_locker_lock (mu_locker_t lock, enum mu_locker_mode mode)
 int
 mu_locker_lock (mu_locker_t lock)
 {
-  return _mu_locker_lock (lock, mu_lck_exc);
+  return mu_locker_lock_mode (lock, mu_lck_exc);
 }
 
 int
diff --git a/libmailutils/tests/url-parse.c b/libmailutils/tests/url-parse.c
index 6b02ccf..b854ae9 100644
--- a/libmailutils/tests/url-parse.c
+++ b/libmailutils/tests/url-parse.c
@@ -83,6 +83,7 @@ struct mu_kwd parse_kwtab[] = {
   { "slash", MU_URL_PARSE_SLASH },
   { "dslash_optional", MU_URL_PARSE_DSLASH_OPTIONAL },
   { "default", MU_URL_PARSE_DEFAULT },
+  { "local", MU_URL_PARSE_LOCAL },
   { "all", MU_URL_PARSE_ALL },
   { NULL }
 };
diff --git a/libmailutils/tests/url.at b/libmailutils/tests/url.at
index 3f3f822..d8b46c0 100644
--- a/libmailutils/tests/url.at
+++ b/libmailutils/tests/url.at
@@ -806,6 +806,44 @@ port 0
 path </var/spool/mail/gray%40gnu.org>
 ])
 
+m4_pushdef([URL_PARSE_OPTIONS],[slash])
+TESTURL([],[],
+[./file.db],
+[scheme <file>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path <./file.db>
+])
+
+m4_define([URL_PARSE_OPTIONS],[slash hint=gdbm://])
+TESTURL([(gdbm) ./file.db],[],
+[./file.db],
+[scheme <gdbm>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path <./file.db>
+])
+m4_popdef([URL_PARSE_OPTIONS])
+
+m4_pushdef([URL_PARSE_OPTIONS],[local hint=db://])
+TESTURL([],[],
+[local],
+[scheme <db>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path <local>
+])
+m4_popdef([URL_PARSE_OPTIONS])
+
 TESTURL([],[],
 [| /bin/mailman request list%40dom],
 [[scheme <prog>
@@ -819,6 +857,21 @@ query[0] <request>
 query[1] <list%40dom>
 ]])
 
+m4_pushdef([URL_PARSE_OPTIONS],[pipe hint=ext://])
+TESTURL([(ext) | /bin/mailman request list%40dom],[],
+[| /bin/mailman request list%40dom],
+[[scheme <ext>
+user <>
+passwd <>
+auth <>
+host <>
+port 0
+path </bin/mailman>
+query[0] <request>
+query[1] <list%40dom>
+]])
+m4_popdef([URL_PARSE_OPTIONS])
+
 TESTURL([],[],
 [prog:///bin/mailman?request&list%40dom],
 [[scheme <prog>
diff --git a/libmailutils/url/create.c b/libmailutils/url/create.c
index 6027545..0c7347b 100644
--- a/libmailutils/url/create.c
+++ b/libmailutils/url/create.c
@@ -220,6 +220,9 @@ _mu_url_ctx_parse_host (struct mu_url_ctx *ctx, int has_host)
   int rc;
   mu_url_t url = ctx->url;
   
+  if (ctx->flags & MU_URL_PARSE_LOCAL)
+    return _mu_url_ctx_parse_path (ctx);
+  
   rc = getkn (ctx, "[:/;?");
   if (rc)
     return rc;
@@ -400,18 +403,16 @@ _mu_url_ctx_parse (struct mu_url_ctx *ctx)
 static int
 _mu_url_create_internal (struct mu_url_ctx *ctx, mu_url_t hint)
 {
-  int rc;
+  int rc = 0;
   mu_url_t url = ctx->url;
-
+  const char *scheme = NULL;
+  
   if ((ctx->flags & MU_URL_PARSE_PIPE) && ctx->input[0] == '|')
     {
       struct mu_wordsplit ws;
       size_t i;
       
-      rc = str_assign (&url->scheme, "prog");
-      if (rc)
-	return rc;
-      url->flags |= MU_URL_SCHEME;
+      scheme = "prog";
       ctx->flags &= ~MU_URL_PARSE_HEXCODE;
       if (mu_wordsplit (ctx->input + 1, &ws, MU_WRDSF_DEFFLAGS))
 	return errno;
@@ -431,12 +432,11 @@ _mu_url_create_internal (struct mu_url_ctx *ctx, mu_url_t hint)
       mu_wordsplit_free (&ws);
       url->flags |= MU_URL_QUERY;
     }
-  else if ((ctx->flags & MU_URL_PARSE_SLASH) && ctx->input[0] == '/')
+  else if ((ctx->flags & MU_URL_PARSE_SLASH) &&
+	   (ctx->input[0] == '/' ||
+	    (ctx->input[0] == '.' && ctx->input[1] == '/')))
     {
-      rc = str_assign (&url->scheme, "file");
-      if (rc)
-	return rc;
-      url->flags |= MU_URL_SCHEME;
+      scheme = "file";
       ctx->flags &= ~MU_URL_PARSE_HEXCODE;
       rc = str_assign (&url->path, ctx->input);
       if (rc == 0)
@@ -457,7 +457,17 @@ _mu_url_create_internal (struct mu_url_ctx *ctx, mu_url_t hint)
     }
 
   if (!(url->flags & MU_URL_SCHEME))
-    return MU_ERR_URL_MISS_PARTS;
+    {
+      if (scheme)
+	{
+	  rc = str_assign (&url->scheme, scheme);
+	  if (rc)
+	    return rc;
+	  url->flags |= MU_URL_SCHEME;
+	}
+      else
+	return MU_ERR_URL_MISS_PARTS;
+    }
   
   /* RFC 1738, section 2.1, lower the scheme case */
   mu_strlower (url->scheme);
diff --git a/libmu_dbm/berkeley.c b/libmu_dbm/berkeley.c
index dd33fc7..b07fa80 100644
--- a/libmu_dbm/berkeley.c
+++ b/libmu_dbm/berkeley.c
@@ -26,6 +26,7 @@
 #include <mailutils/errno.h>
 #include <mailutils/error.h>
 #include <mailutils/stream.h>
+#include <mailutils/locker.h>
 #include "mudbm.h"
 
 #if defined(WITH_BDB)
@@ -35,6 +36,7 @@ struct bdb_file
 {
   DB *db;
   DBC *dbc;
+  mu_locker_t locker;
 };
 
 static int
@@ -59,57 +61,71 @@ _bdb_get_fd (mu_dbm_file_t db, int *pag, int *dir)
 }
   
 static int
-_bdb_open (mu_dbm_file_t mdb, int flags, int mode)
-{
-  struct bdb_file *bdb_file;
-  int f, rc;
-  DB *db;
-
+do_bdb_open (mu_dbm_file_t mdb, int flags, int mode)
+{  
+  struct bdb_file *bdb_file = mdb->db_descr;
+  int f, rc, locker_flags;
+  enum mu_locker_mode locker_mode;
+    
   switch (flags)
     {
     case MU_STREAM_CREAT:
       f = DB_CREATE|DB_TRUNCATE;
+      locker_mode = mu_lck_exc;
       break;
       
     case MU_STREAM_READ:
       f = DB_RDONLY;
+      locker_mode = mu_lck_shr;
       break;
       
     case MU_STREAM_RDWR:
       f = DB_CREATE;
+      locker_mode = mu_lck_exc;
       break;
       
     default:
       return EINVAL;
     }
 
-#if WITH_BDB == 2  
-  rc = db_open (db->db_name, DB_HASH, f, mode, NULL, NULL, &db);
+#ifdef DB_FCNTL_LOCKING
+  f |= DB_FCNTL_LOCKING;
+  locker_flags = MU_LOCKER_KERNEL;
 #else
-  rc = db_create (&db, NULL, 0);
-  if (rc != 0 || db == NULL)
-    return MU_ERR_FAILURE;
-# if DB_VERSION_MAJOR == 3
-  rc = db->open (db, mdb->db_name, NULL, DB_HASH, f, mode);
-# else
-  rc = db->open (db, NULL, mdb->db_name, NULL, DB_HASH, f, mode);
-# endif
+  locker_flags = 0;
 #endif
-  
+  rc = mu_locker_create (&bdb_file->locker, mdb->db_name,
+			 locker_flags|MU_LOCKER_RETRY);
   if (rc)
-    return MU_ERR_FAILURE;
+    return rc;
 
-  bdb_file = malloc (sizeof *bdb_file);
-  if (!bdb_file)
+  rc = mu_locker_lock_mode (bdb_file->locker, locker_mode);
+  switch (rc)
     {
-      db->close (db, 0);
-      return ENOMEM;
-    }
-  bdb_file->db = db;
-  bdb_file->dbc = NULL;
+    case 0:
+      break;
 
-  mdb->db_descr = bdb_file;
+    case EACCES:
+      mu_locker_destroy (&bdb_file->locker);
+      break;
+      
+    default:
+      return rc;
+    }
+  
+  rc = db_create (&bdb_file->db, NULL, 0);
+  if (rc != 0 || bdb_file->db == NULL)
+    return MU_ERR_FAILURE;
+#if DB_VERSION_MAJOR == 3
+  rc = bdb_file->db->open (bdb_file->db, mdb->db_name, NULL, DB_HASH, f, mode);
+#else
+  rc = bdb_file->db->open (bdb_file->db, NULL, mdb->db_name, NULL, DB_HASH,
+			   f, mode);
+#endif
   
+  if (rc)
+    return MU_ERR_FAILURE;
+
   return 0;
 }
 
@@ -119,7 +135,13 @@ _bdb_close (mu_dbm_file_t db)
   if (db->db_descr)
     {
       struct bdb_file *bdb_file = db->db_descr;
-      bdb_file->db->close (bdb_file->db, 0);
+      if (bdb_file->db)
+	bdb_file->db->close (bdb_file->db, 0);
+      if (bdb_file->locker)
+	{
+	  mu_locker_unlock (bdb_file->locker);
+	  mu_locker_destroy (&bdb_file->locker);
+	}
       free (bdb_file);
       db->db_descr = NULL;
     }
@@ -127,6 +149,23 @@ _bdb_close (mu_dbm_file_t db)
 }
 
 static int
+_bdb_open (mu_dbm_file_t mdb, int flags, int mode)
+{
+  int rc;
+  struct bdb_file *bdb_file;
+
+  bdb_file = calloc (1, sizeof *bdb_file);
+  if (!bdb_file)
+    return ENOMEM;
+
+  mdb->db_descr = bdb_file;
+  rc = do_bdb_open (mdb, flags, mode);
+  if (rc)
+    _bdb_close (mdb);
+  return rc;
+}
+
+static int
 _bdb_fetch (mu_dbm_file_t db, struct mu_dbm_datum const *key,
 	    struct mu_dbm_datum *ret)
 {
diff --git a/mu/dbm.c b/mu/dbm.c
index a880543..84bcded 100644
--- a/mu/dbm.c
+++ b/mu/dbm.c
@@ -35,6 +35,7 @@ static char dbm_doc[] = N_("mu dbm - DBM management tool\n"
 "Valid COMMANDs are:\n"
 "\n"
 "  create or load - create the database\n"
+"  dump           - dump the database\n"
 "  list           - list contents of the database\n"
 "  delete         - delete specified keys from the database\n"
 "  add            - add records to the database\n"


hooks/post-receive
-- 
GNU Mailutils


