+2006-01-24 Archit Shah <ashah@redhat.com>
+ Tom Tromey <tromey@redhat.com>
+
+ * prims.cc (next_property_value): Never return NULL.
+ (process_gcj_properties): Copy 'props' before using it.
+
2006-01-23 Keith Seitz <keiths@redhat.com>
* java/lang/Class.h (_Jv_FindInterpreterMethod): Add new declaration.
while (isspace (*s))
s++;
- // If we've reached the end, return NULL.
- if (*s == 0)
- return NULL;
-
// Determine the length of the property value.
while (s[l] != 0
&& ! isspace (s[l])
process_gcj_properties ()
{
char *props = getenv("GCJ_PROPERTIES");
- char *p = props;
- size_t length;
- size_t property_count = 0;
if (NULL == props)
return;
+ // Later on we will write \0s into this string. It is simplest to
+ // just duplicate it here.
+ props = strdup (props);
+
+ char *p = props;
+ size_t length;
+ size_t property_count = 0;
+
// Whip through props quickly in order to count the number of
// property values.
while (p && (p = next_property_key (p, &length)))