--- kdeui/kbugreport.cpp.orig	Fri Mar  8 01:18:10 2002
+++ kdeui/kbugreport.cpp	Thu Mar 28 17:06:46 2002
@@ -191,8 +191,14 @@
   struct utsname unameBuf;
   uname( &unameBuf );
   d->os = QString::fromLatin1( unameBuf.sysname ) +
-					" (" + QString::fromLatin1( unameBuf.machine ) + ") "
-          "release " + QString::fromLatin1( unameBuf.release );
+#ifdef _AIX
+	//On AIX, the OS level is obtained as "version"."release" .
+	//Don't use "machine"--it's the CPU ID, not architecture.
+	" release " + QString::fromLatin1( unameBuf.version ) + "." +
+#else
+	" (" + QString::fromLatin1( unameBuf.machine ) + ") release " + 
+#endif
+	QString::fromLatin1( unameBuf.release );
 
   tmpLabel = new QLabel(d->os, parent);
   glay->addMultiCellWidget( tmpLabel, row, row, 1, 2 );
--- configure.in.orig	Thu Mar 28 20:35:46 2002
+++ configure.in	Thu Mar 28 20:36:07 2002
@@ -265,7 +265,9 @@
 case `uname -s` in
 AIX)
   IBM_ARCH=PowerPC #good default
+  changequote(, )dnl
   if [ -x /usr/sbin/lsdev -a -x /usr/sbin/lsattr ]; then
+  changequote([, ])dnl
     IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
     if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
       IBM_ARCH=POWER
--- configure.in.in.orig	Thu Mar 28 20:34:46 2002
+++ configure.in.in	Thu Mar 28 20:37:21 2002
@@ -265,7 +265,9 @@
 case `uname -s` in
 AIX)
   IBM_ARCH=PowerPC #good default
+  changequote(, )dnl
   if [ -x /usr/sbin/lsdev -a -x /usr/sbin/lsattr ]; then
+  changequote([, ])dnl
     IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
     if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
       IBM_ARCH=POWER
--- khtml/misc/loader_jpeg.cpp.orig	Thu Mar 28 22:14:06 2002
+++ khtml/misc/loader_jpeg.cpp	Thu Mar 28 22:16:10 2002
@@ -35,6 +35,9 @@
 
 extern "C" {
 #define XMD_H
+#ifdef HAVE_STDLIB_H
+#undef HAVE_STDLIB_H
+#endif
 #include <jpeglib.h>
 #undef const
 }
--- khtml/rendering/font.cpp.orig	Mon Apr  1 16:39:17 2002
+++ khtml/rendering/font.cpp	Mon Apr  1 16:57:18 2002
@@ -46,8 +46,8 @@
 	qstr.setLength( slen );
 	QChar *uc = (QChar *)qstr.unicode();
 	for( int i = 0; i < slen; i++ )
-	    if ( uc->unicode() == 0xa0 )
-		*uc = ' ';
+	    if ( (uc+i)->unicode() == 0xa0 )
+		*(uc+i) = ' ';
     }
     
     // ### fixme for RTL
@@ -103,8 +103,8 @@
 	qstr.setLength( slen );
 	QChar *uc = (QChar *)qstr.unicode();
 	for( int i = 0; i < slen; i++ )
-	    if ( uc->unicode() == 0xa0 )
-		*uc = ' ';
+	    if ( (uc+i)->unicode() == 0xa0 )
+		*(uc+i) = ' ';
     }
     // ### might be a little inaccurate
     int w = fm.width( qstr, len );
--- kio/kssl/kopenssl.cc.orig	Mon Apr 15 07:26:23 2002
+++ kio/kssl/kopenssl.cc	Mon Apr 15 07:41:18 2002
@@ -21,6 +21,7 @@
 #include <kdebug.h>
 #include <kconfig.h>
 #include <kstaticdeleter.h>
+#include <qregexp.h>
 
 
 #include <stdio.h>
@@ -293,7 +294,9 @@
          if (!alib.isEmpty() && !alib.endsWith("/"))
             alib += "/";
          alib += *shit;
-	 if (!access(alib.latin1(), R_OK))
+	 QString tmpStr(alib.latin1());
+	 tmpStr.replace(QRegExp("\\(.*\\)"), "");
+	 if (!access(tmpStr.latin1(), R_OK))
             _cryptoLib = ll->globalLibrary(alib.latin1());
          if (_cryptoLib) break;
       }
@@ -413,7 +416,9 @@
          if (!alib.isEmpty() && !alib.endsWith("/"))
             alib += "/";
          alib += *shit;
-	 if (!access(alib.latin1(), R_OK))
+	 QString tmpStr(alib.latin1());
+	 tmpStr.replace(QRegExp("\\(.*\\)"), "");
+	 if (!access(tmpStr.latin1(), R_OK))
          	_sslLib = ll->globalLibrary(alib.latin1());
          if (_sslLib) break;
       }
--- kdecore/fakes.c.orig	Thu Jun 20 08:43:54 2002
+++ kdecore/fakes.c	Thu Jun 20 08:43:59 2002
@@ -1,6 +1,9 @@
 /* This file is part of the KDE libraries
    Copyright (c) 2000 The KDE Project
 
+   unsetenv() taken from the GNU C Library.
+   Copyright (C) 1992,1995-1999,2000-2002 Free Software Foundation, Inc.
+
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License version 2 as published by the Free Software Foundation.
@@ -54,19 +57,40 @@
 
 #include <string.h>
 #include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
 
-int unsetenv(const char * name) {
-    int i;
-    char * a;
-
-    i = strlen(name) + 2;
-    a = (char*)malloc(i);
-    if (!a) return 1;
-
-    strcpy(a, name);
-    strcat(a, "=");
+int
+unsetenv (name)
+     const char *name;
+{
+  size_t len;
+  char **ep;
+
+  if (name == NULL || *name == '\0' || strchr (name, '=') != NULL)
+    {
+      errno = EINVAL;
+      return -1;
+    }
+
+  len = strlen (name);
+
+  ep = environ;
+  while (*ep != NULL)
+    if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
+      {
+	/* Found it.  Remove this pointer by moving later ones back.  */
+	char **dp = ep;
+
+	do
+	  dp[0] = dp[1];
+	while (*dp++);
+	/* Continue the loop in case NAME appears again.  */
+      }
+    else
+      ++ep;
 
-    return putenv(a);
+  return 0;
 }
 
 #endif
