]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-perl/modify.c
happy belated New Year
[openldap] / servers / slapd / back-perl / modify.c
index 56d69eb2099d16b06222749bc46b2493694381d9..c2062ad0480aa81ff06c3c22c0e82b79607996e0 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1999-2004 The OpenLDAP Foundation.
+ * Copyright 1999-2010 The OpenLDAP Foundation.
  * Portions Copyright 1999 John C. Quillan.
  * Portions Copyright 2002 myinternet Limited.
  * All rights reserved.
  * <http://www.OpenLDAP.org/license.html>.
  */
 
-#include <EXTERN.h>
-#include <perl.h>
-#undef _ /* #defined by both Perl and ac/localize.h */
-
-#ifdef HAVE_WIN32_ASPERL
-#include "asperl_undefs.h"
-#endif
-
-#include "portable.h"
-
-#include <stdio.h>
-
-#include "slap.h"
-
 #include "perl_back.h"
 
 int
@@ -41,6 +27,9 @@ perl_back_modify(
        int count;
        int i;
 
+#if defined(HAVE_WIN32_ASPERL) || defined(USE_ITHREADS)
+       PERL_SET_CONTEXT( PERL_INTERPRETER );
+#endif
 
        ldap_pvt_thread_mutex_lock( &perl_interpreter_mutex );  
 
@@ -77,6 +66,11 @@ perl_back_modify(
                        {
                                XPUSHs(sv_2mortal(newSVpv( mods->sm_values[i].bv_val, 0 )));
                        }
+
+                       /* Fix delete attrib without value. */
+                       if ( i == 0) {
+                               XPUSHs(sv_newmortal());
+                       }
                }
 
                PUTBACK;