Do not remap framework assembly if it's version is higher than the runtime version
[mono.git] / eglib / src / gstr.c
index fccf2651db26b05678dea8a5e4b1472f6d5a0753..3e976c5a2edfe3019a294daad9f45d355f7da250 100644 (file)
@@ -32,6 +32,8 @@
 #include <ctype.h>
 #include <glib.h>
 
+#include "vasprintf.h"
+
 /* This is not a macro, because I dont want to put _GNU_SOURCE in the glib.h header */
 gchar *
 g_strndup (const gchar *str, gsize n)
@@ -251,8 +253,12 @@ g_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens)
        }
 
        if (*string) {
-               /* Add the rest of the string as the last element */
-               add_to_vector (&vector, size, g_strdup (string));
+               if (strcmp (string, delimiter) == 0)
+                       add_to_vector (&vector, size, g_strdup (""));
+               else {
+                       /* Add the rest of the string as the last element */
+                       add_to_vector (&vector, size, g_strdup (string));
+               }
                size++;
        }
        
@@ -357,6 +363,9 @@ g_strreverse (gchar *str)
        if (str == NULL)
                return NULL;
 
+       if (*str == 0)
+               return str;
+
        for (i = 0, j = strlen (str) - 1; i < j; i++, j--) {
                c = str [i];
                str [i] = str [j];