r300: fix valgrind warnings
[mesa.git] / src / mesa / drivers / dri / common / xmlconfig.c
index c313d71e8036b0996103256d0b7dc96242d503d3..46ba2ffbfedb64a1b7f7845fa347026c5dabc87c 100644 (file)
@@ -27,7 +27,7 @@
  * \author Felix Kuehling
  */
 
-#include "glheader.h"
+#include "main/glheader.h"
 
 #include <string.h>
 #include <assert.h>
@@ -35,7 +35,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <errno.h>
-#include "imports.h"
+#include "main/imports.h"
 #include "dri_util.h"
 #include "xmlconfig.h"
 
@@ -63,6 +63,12 @@ extern char *program_invocation_name, *program_invocation_short_name;
 #elif defined(__NetBSD__) && defined(__NetBSD_Version) && (__NetBSD_Version >= 106000100)
 #    include <stdlib.h>
 #    define GET_PROGRAM_NAME() getprogname()
+#elif defined(__sun)
+/* Solaris has getexecname() which returns the full path - return just
+   the basename to match BSD getprogname() */
+#    include <stdlib.h>
+#    include <libgen.h>
+#    define GET_PROGRAM_NAME() basename(getexecname())
 #endif
 
 #if !defined(GET_PROGRAM_NAME)
@@ -279,7 +285,7 @@ static GLfloat strToF (const XML_Char *string, const XML_Char **tail) {
 /** \brief Parse a value of a given type. */
 static GLboolean parseValue (driOptionValue *v, driOptionType type,
                             const XML_Char *string) {
-    const XML_Char *tail;
+    const XML_Char *tail = NULL;
   /* skip leading white-space */
     string += strspn (string, " \f\n\r\t\v");
     switch (type) {