From e5236827b38c085801193ca01405e8075ce5bc98 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=B4me=20Bernigaud?= <come.bernigaud@laposte.net>
Date: Thu, 11 Apr 2013 16:33:29 +0200
Subject: [PATCH] Fixed: #2282 fixed cn regexp

---
 schema2ldif | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/schema2ldif b/schema2ldif
index 875d9a1..871d917 100755
--- a/schema2ldif
+++ b/schema2ldif
@@ -15,7 +15,7 @@ use Pod::Usage;
 
 my $cn      = "" ;
 my $branch  = "cn=schema,cn=config";
-my $help = 0;
+my $help    = 0;
 
 # Process command-line
 
@@ -34,7 +34,7 @@ if ($cn eq '') {
   $cn = $ARGV[0];
   die "Error: $cn is not a file\n" unless -f $cn;
 
-  $cn =~ s|^.+/([^/]+)\.[^.]+$|$1|;
+  $cn =~ s|^(.*/)?([^/]+)\.[^.]+$|$2|;
 }
 
 # [openldap.ldif]
-- 
GitLab