From 09285c09893018eeb12a73fafd62ba2c97d44bcc Mon Sep 17 00:00:00 2001
From: Anders Johansson <anders@roxen.com>
Date: Wed, 21 Nov 2001 17:22:41 +0100
Subject: [PATCH] Safeguard in case of empty filter string.

Rev: lib/modules/Protocols.pmod/LDAP.pmod/client.pike:1.34
---
 lib/modules/Protocols.pmod/LDAP.pmod/client.pike | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/modules/Protocols.pmod/LDAP.pmod/client.pike b/lib/modules/Protocols.pmod/LDAP.pmod/client.pike
index fec2a6cb0a..f934ef3a6e 100644
--- a/lib/modules/Protocols.pmod/LDAP.pmod/client.pike
+++ b/lib/modules/Protocols.pmod/LDAP.pmod/client.pike
@@ -2,7 +2,7 @@
 
 // LDAP client protocol implementation for Pike.
 //
-// $Id: client.pike,v 1.33 2001/11/05 11:52:03 hop Exp $
+// $Id: client.pike,v 1.34 2001/11/21 16:22:41 anders Exp $
 //
 // Honza Petrous, hop@unibase.cz
 //
@@ -349,7 +349,7 @@ int _prof_gtim;
   void create(string|void url, object|void context)
   {
 
-    info = ([ "code_revision" : ("$Revision: 1.33 $"/" ")[1] ]);
+    info = ([ "code_revision" : ("$Revision: 1.34 $"/" ")[1] ]);
 
     if(!url || !sizeof(url))
       url = LDAP_DEFAULT_URL;
@@ -789,11 +789,11 @@ int _prof_gtim;
     int op ;
 
     DWRITE("client.make_filter: filter=["+filter+"]\n");
+
+    if (!sizeof(filter)) return make_simple_filter(filter);
+
     // strip leading and trailing spaces
-    while(filter[0] == ' ')
-      filter = filter[1..];
-    while(filter[-1] == ' ')
-      filter = reverse(reverse(filter)[1..]);
+    filter = String.trim_all_whites(filter);
 
     // strip leading and trailing brackets
 #if 1
-- 
GitLab