[Kst] extragear/graphics/kst

George Staikos staikos at kde.org
Wed Nov 2 16:56:51 CET 2005


SVN commit 476992 by staikos:

Fix solaris build.  This will work at least until I can determine if kdefakes is
an option for us


 M  +2 -0      configure.in.in  
 M  +42 -0     kst/ksttimezones.cpp  


--- trunk/extragear/graphics/kst/configure.in.in #476991:476992
@@ -4,6 +4,8 @@
 AM_PROG_LEX
 dnl AC_OUTPUT(kst/kst.spec kst/kst.lsm)
 
+AC_CHECK_UNSETENV
+
 AC_HEADER_TIME
 AC_CHECK_HEADERS(sys/time.h)
 
--- trunk/extragear/graphics/kst/kst/ksttimezones.cpp #476991:476992
@@ -40,6 +40,48 @@
 
 #define UTC_ZONE "UTC"
 
+#ifndef HAVE_UNSETENV
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+
+#ifndef environ
+extern char ** environ;
+#endif
+
+void unsetenv(const char *name)
+{
+  size_t len;
+  char **ep;
+
+  if (name == NULL || *name == '\0' || strchr (name, '=') != NULL) {
+    errno = EINVAL;
+    return;
+  }
+
+  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;
+    }
+  }
+}
+
+#endif /* !HAVE_UNSETENV */
+
 /**
  * Find out if the given standard (e.g. "GMT") and daylight savings time
  * (e.g. "BST", but which may be empty) abbreviated timezone names match


More information about the Kst mailing list