$NetBSD: patch-bd,v 1.4 2002/08/28 07:15:44 skrll Exp $

--- kio/kssl/kopenssl.cc.orig	Mon Aug 12 19:33:58 2002
+++ kio/kssl/kopenssl.cc
@@ -174,7 +174,7 @@ void KOpenSSLProxy::destroy() {
   _me = NULL;
 }
 
-#ifdef __OpenBSD__
+#if defined(__OpenBSD__) || defined(__NetBSD__)
 #include <qdir.h>
 #include <qstring.h>
 #include <qstringlist.h>
@@ -237,26 +237,22 @@ KConfig *cfg;
 
    delete cfg;
 
-#ifdef __OpenBSD__
-   {
-   QString libname = findMostRecentLib("/usr/lib", "crypto");
-   if (!libname.isNull())
-         _cryptoLib = ll->globalLibrary(libname.latin1());
-   }
-#else
    libpaths 
-            #ifdef _AIX
+#ifdef _AIX
             << "/opt/freeware/lib/"
-	    #endif
+#endif
 	    << "/usr/lib/"
+#if !defined(__NetBSD__) && !defined(__OpenBSD__)
 	    << "/usr/ssl/lib/"
             << "/usr/local/lib/"
             << "/usr/local/openssl/lib/"
             << "/usr/local/ssl/lib/"
             << "/opt/openssl/lib/"
             << "/lib/"
+#endif
             << "";
 
+#if !defined(__NetBSD__) && !defined(__OpenBSD__)
 // FIXME: #define here for the various OS types to optimize
    libnamess 
 	     #ifdef hpux
@@ -285,10 +281,16 @@ KConfig *cfg;
 	     << "libcrypto.so.0.9.6"
              #endif
 	     ;
+#endif
 
    for (QStringList::Iterator it = libpaths.begin();
                               it != libpaths.end();
                               ++it) {
+#if defined(__NetBSD__) || defined(__OpenBSD__)
+      QString libname = findMostRecentLib(*it, "crypto");
+      if (!libname.isNull())
+            _cryptoLib = ll->globalLibrary(libname.latin1());
+#else
       for (QStringList::Iterator shit = libnamesc.begin();
                                  shit != libnamesc.end();
                                  ++shit) {
@@ -300,9 +302,9 @@ KConfig *cfg;
             _cryptoLib = ll->globalLibrary(alib.latin1());
          if (_cryptoLib) break;
       }
+#endif
       if (_cryptoLib) break;
    }
-#endif
 
    if (_cryptoLib) {
 #ifdef HAVE_SSL 
@@ -401,16 +403,14 @@ KConfig *cfg;
 #endif
    }
 
-#ifdef __OpenBSD__
-   {
-   QString libname = findMostRecentLib("/usr/lib", "ssl");
-   if (!libname.isNull())
-         _sslLib = ll->globalLibrary(libname.latin1());
-   }
-#else
    for (QStringList::Iterator it = libpaths.begin();
                               it != libpaths.end();
                               ++it) {
+#if defined(__OpenBSD__) || defined(__NetBSD__)
+      QString libname = findMostRecentLib(*it, "ssl");
+      if (!libname.isNull())
+           _sslLib = ll->globalLibrary(libname.latin1());
+#else
       for (QStringList::Iterator shit = libnamess.begin();
                                  shit != libnamess.end();
                                  ++shit) {
@@ -422,9 +422,9 @@ KConfig *cfg;
          	_sslLib = ll->globalLibrary(alib.latin1());
          if (_sslLib) break;
       }
+#endif
       if (_sslLib) break;
    }
-#endif
 
    if (_sslLib) {
 #ifdef HAVE_SSL 
