* suck_add: Check for lce != NULL before adding it to the list, since
[cacao.git] / src / vm / suck.c
index 9dc7875e1ee6497bc0f5abb79e3d91c00e272309..0ebe88b1f554dfdedbcaa8f9f4757b93d9a23de1 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: suck.c 4007 2005-12-22 16:26:03Z twisti $
+   $Id: suck.c 4095 2006-01-08 21:32:25Z twisti $
 
 */
 
@@ -207,19 +207,18 @@ void suck_add(char *classpath)
                                lce->pathlen = filenamelen;
                        }
 
-                       /* add current classpath entry */
+                       /* add current classpath entry, if no error */
 
-                       list_addlast(list_classpath_entries, lce);
+                       if (lce)
+                               list_addlast(list_classpath_entries, lce);
                }
 
                /* goto next classpath entry, skip ':' delimiter */
 
-               if ((*end) == ':') {
+               if ((*end) == ':')
                        start = end + 1;
-
-               } else {
+               else
                        start = end;
-               }
        }
 }
 
@@ -324,12 +323,10 @@ void suck_add_from_property(char *key)
 
                /* goto next entry, skip ':' delimiter */
 
-               if ((*end) == ':') {
+               if ((*end) == ':')
                        start = end + 1;
-
-               } else {
+               else
                        start = end;
-               }
        }
 }